Some properties for things with lists of items.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -321,6 +321,22 @@ public:
|
||||
static bool GetAutoWindowMenu() { return false; }
|
||||
}
|
||||
#endif
|
||||
|
||||
%pythoncode {
|
||||
def GetMenus(self):
|
||||
"""Return a list of (menu, label) items for the menus in the MenuBar. """
|
||||
return [(self.GetMenu(i), self.GetLabelTop(i))
|
||||
for i in range(self.GetMenuCount())]
|
||||
|
||||
def SetMenus(self, items):
|
||||
"""Clear and add new menus to the MenuBar from a list of (menu, label) items. """
|
||||
for i in range(self.GetMenuCount()-1, -1, -1):
|
||||
self.Remove(i)
|
||||
for m, l in items:
|
||||
self.Append(m, l)
|
||||
}
|
||||
%property(Menus, GetMenus, SetMenus);
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user