Changeset 1496

Show
Ignore:
Timestamp:
07/21/08 20:33:09 (5 weeks ago)
Author:
rob
Message:

Changed CloseTab? and NewTab? to work as popup actions

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/peppy/mainmenu.py

    r1493 r1496  
    3232    def action(self, index=-1, multiplier=1): 
    3333        assert self.dprint("id=%x name=%s index=%s" % (id(self),self.name,str(index))) 
    34         self.frame.open("about:blank", force_new_tab=True) 
     34        # Have to use a CallAfter because this action may be called in a popup menu 
     35        wx.CallAfter(self.frame.open, "about:blank", force_new_tab=True) 
    3536 
    3637class CloseTab(SelectAction): 
     
    4142    def action(self, index=-1, multiplier=1): 
    4243        assert self.dprint("id=%x name=%s index=%s" % (id(self),self.name,str(index))) 
    43         self.frame.tabs.closeTab() 
     44        # FIXME: change this so I don't have to break encapsulation on the frame's notebook 
     45        tab = self.frame.tabs.context_tab 
     46        wx.CallAfter(self.frame.tabs.closeTab, tab) 
    4447 
    4548class MoveTabToNewWindow(SelectAction):