Update flatmenu.py

FlatMenu fix for passing ids to Remove and DestroyItem
This commit is contained in:
arjones6
2022-08-02 14:42:52 -04:00
parent d57949fdcf
commit 937a9b31e9

View File

@@ -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)