mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	If a menu shortcut is a tuple in stead of a char it is a tuple (modifierkeys, char [, glyph]).
This commit is contained in:
		
							parent
							
								
									1836dbe22d
								
							
						
					
					
						commit
						13681b73b5
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		|  | @ -528,7 +528,13 @@ def additem(self, label, shortcut=None, callback=None, kind=None): | |||
| 		self.items.append(label, shortcut, callback, kind) | ||||
| 		item = len(self.items) | ||||
| 		self.menu.SetMenuItemText(item, label)		# set the actual text | ||||
| 		if shortcut: | ||||
| 		if shortcut and type(shortcut) == type(()): | ||||
| 			modifiers, char = shortcut[:2] | ||||
| 			self.menu.SetItemCmd(item, ord(char)) | ||||
| 			self.menu.SetMenuItemModifiers(item, modifiers) | ||||
| 			if len(shortcut) > 2: | ||||
| 				self.menu.SetMenuItem | ||||
| 		elif shortcut:	 | ||||
| 			self.menu.SetItemCmd(item, ord(shortcut)) | ||||
| 		return item | ||||
| 		 | ||||
|  | @ -1018,9 +1024,9 @@ def makeusermenus(self): | |||
| 		self.saveitem = MenuItem(m, "Save", "S", self.save) | ||||
| 		Separator(m) | ||||
| 		self.optionsmenu = mm = SubMenu(m, "Options") | ||||
| 		self.opt1 = CheckItem(mm, "Arguments") | ||||
| 		self.opt2 = CheckItem(mm, "Being hit on the head lessons") | ||||
| 		self.opt3 = CheckItem(mm, "Complaints") | ||||
| 		self.opt1 = CheckItem(mm, "Arguments", "A") | ||||
| 		self.opt2 = CheckItem(mm, "Being hit on the head lessons", (kMenuOptionModifier, "A")) | ||||
| 		self.opt3 = CheckItem(mm, "Complaints", (kMenuOptionModifier|kMenuNoCommandModifier, "A")) | ||||
| 		Separator(m) | ||||
| 		self.quititem = MenuItem(m, "Quit", "Q", self.quit) | ||||
| 	 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen