def MakeMenu(self): """Make a menu that can be popped up later""" menu = wx.Menu() keys = self.menuColours.keys() keys.sort() for k in keys: text = self.menuColours[k] menu.Append(k, text, kind=wx.ITEM_CHECK) wx.EVT_MENU_RANGE(self, 100, 200, self.OnMenuSetColour) wx.EVT_UPDATE_UI_RANGE(self, 100, 200, self.OnCheckMenuColours) menu.Break() for x in range(1, self.maxThickness+1): menu.Append(x, str(x), kind=wx.ITEM_CHECK) wx.EVT_MENU_RANGE(self, 1, self.maxThickness, self.OnMenuSetThickness) wx.EVT_UPDATE_UI_RANGE(self, 1, self.maxThickness, self.OnCheckMenuThickness) self.menu = menu
def care_of_menu(self, parent): self.artub_frame = parent wx.EVT_MENU_RANGE(wx.GetApp(), parent.undoID, parent.pasteID, parent.undo) wx.EVT_UPDATE_UI_RANGE(wx.GetApp(), parent.undoID, parent.pasteID, parent.undo_update_ui)