From 937a9b31e99de3bc70f3a5fd20ba054ee4ba6be8 Mon Sep 17 00:00:00 2001 From: arjones6 Date: Tue, 2 Aug 2022 14:42:52 -0400 Subject: [PATCH] Update flatmenu.py FlatMenu fix for passing ids to Remove and DestroyItem --- wx/lib/agw/flatmenu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wx/lib/agw/flatmenu.py b/wx/lib/agw/flatmenu.py index 656e245e..aba6d27e 100644 --- a/wx/lib/agw/flatmenu.py +++ b/wx/lib/agw/flatmenu.py @@ -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)