mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Update flatmenu.py
FlatMenu fix for passing ids to Remove and DestroyItem
This commit is contained in:
@@ -4096,7 +4096,7 @@ class FlatMenuButton(object):
|
||||
:param `input2`: if not ``None``, it is an integer representing the button `y` position.
|
||||
"""
|
||||
|
||||
if type(input) == type(1):
|
||||
if type(input1) == type(1):
|
||||
self._pos = wx.Point(input1, input2)
|
||||
else:
|
||||
self._pos = input1
|
||||
@@ -4112,7 +4112,7 @@ class FlatMenuButton(object):
|
||||
:param `input2`: if not ``None``, it is an integer representing the button height.
|
||||
"""
|
||||
|
||||
if type(input) == type(1):
|
||||
if type(input1) == type(1):
|
||||
self._size = wx.Size(input1, input2)
|
||||
else:
|
||||
self._size = input1
|
||||
@@ -6646,7 +6646,7 @@ class FlatMenu(FlatMenuBase):
|
||||
:param `item`: can be either a menu item identifier or a plain :class:`FlatMenuItem`.
|
||||
"""
|
||||
|
||||
if type(item) != type(1):
|
||||
if not isinstance(item, (wx.StandardID, int)):
|
||||
item = item.GetId()
|
||||
|
||||
return self._RemoveById(item)
|
||||
@@ -6673,7 +6673,7 @@ class FlatMenu(FlatMenuBase):
|
||||
:param `item`: can be either a menu item identifier or a plain :class:`FlatMenuItem`.
|
||||
"""
|
||||
|
||||
if type(item) != type(1):
|
||||
if not isinstance(item, (wx.StandardID, int)):
|
||||
item = item.GetId()
|
||||
|
||||
self._DestroyById(item)
|
||||
|
||||
Reference in New Issue
Block a user