本文整理汇总了Python中CDMLib.setupMenu方法的典型用法代码示例。如果您正苦于以下问题:Python CDMLib.setupMenu方法的具体用法?Python CDMLib.setupMenu怎么用?Python CDMLib.setupMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDMLib
的用法示例。
在下文中一共展示了CDMLib.setupMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnPopupMenu
# 需要导入模块: import CDMLib [as 别名]
# 或者: from CDMLib import setupMenu [as 别名]
def OnPopupMenu(self, event):
""" Open Popup menu """
if not hasattr(self, 'pup_menus'): return
menu = cdml.setupMenu(self, self.pup_menus, False) # crate popup menu and assign event handler
self.PopupMenu(menu) # open popup menu
menu.Destroy() # remove from memory to show just once when right button is clicked
示例2: OnPopupMenu
# 需要导入模块: import CDMLib [as 别名]
# 或者: from CDMLib import setupMenu [as 别名]
def OnPopupMenu(self, event):
""" Event handler to open Popup menu """
if not hasattr(self, 'pup_menus'): return
menu = cdml.setupMenu(self, self.pup_menus, False) # crate popup menu and assign event handler
page = self.nb.GetCurrentPage()
menu_enable = cdml.iif( page.Id == 0, False, True )
item_add = menu.FindItemById(cdml.IDF_BUTTON1)
item_del = menu.FindItemById(cdml.IDF_BUTTON2)
item_add.Enable(menu_enable)
item_del.Enable(menu_enable)
self.PopupMenu(menu) # open popup menu
menu.Destroy() # remove from memory to show just once when right button is clicked