mirror of https://github.com/python/cpython
support unicode in menu items
This commit is contained in:
parent
addc11edf0
commit
f07518ac22
|
@ -561,7 +561,10 @@ class Menu:
|
||||||
self.menu.AppendMenu('x') # add a dummy string
|
self.menu.AppendMenu('x') # add a dummy string
|
||||||
self.items.append((label, shortcut, callback, kind))
|
self.items.append((label, shortcut, callback, kind))
|
||||||
item = len(self.items)
|
item = len(self.items)
|
||||||
self.menu.SetMenuItemText(item, label) # set the actual text
|
if isinstance(label, unicode):
|
||||||
|
self.menu.SetMenuItemTextWithCFString(item, label)
|
||||||
|
else:
|
||||||
|
self.menu.SetMenuItemText(item, label)
|
||||||
if shortcut and type(shortcut) == type(()):
|
if shortcut and type(shortcut) == type(()):
|
||||||
modifiers, char = shortcut[:2]
|
modifiers, char = shortcut[:2]
|
||||||
self.menu.SetItemCmd(item, ord(char))
|
self.menu.SetItemCmd(item, ord(char))
|
||||||
|
|
Loading…
Reference in New Issue