set_right_click_menu - if no menu specified, use the parent window's right click menu
This commit is contained in:
parent
d82f726f79
commit
9db5a764cc
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
version = __version__ = "4.49.0.1 Unreleased"
|
version = __version__ = "4.49.0.2 Unreleased"
|
||||||
|
|
||||||
_change_log = """
|
_change_log = """
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ _change_log = """
|
||||||
|
|
||||||
4.49.0.1
|
4.49.0.1
|
||||||
Element.set_right_click_menu added so can set or change the right click menu for an element
|
Element.set_right_click_menu added so can set or change the right click menu for an element
|
||||||
|
4.49.0.2
|
||||||
|
Element.set_right_click_menu - If no menu supplied, use the parent form's right click menu
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -1432,9 +1434,13 @@ class Element():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def set_right_click_menu(self, menu):
|
def set_right_click_menu(self, menu=None):
|
||||||
if menu == MENU_RIGHT_CLICK_DISABLED:
|
if menu == MENU_RIGHT_CLICK_DISABLED:
|
||||||
return
|
return
|
||||||
|
if menu is None:
|
||||||
|
menu = self.ParentForm.RightClickMenu
|
||||||
|
if menu is None:
|
||||||
|
return
|
||||||
if menu:
|
if menu:
|
||||||
top_menu = tk.Menu(self.ParentForm.TKroot, tearoff=self.ParentForm.right_click_menu_tearoff, tearoffcommand=self._tearoff_menu_callback)
|
top_menu = tk.Menu(self.ParentForm.TKroot, tearoff=self.ParentForm.right_click_menu_tearoff, tearoffcommand=self._tearoff_menu_callback)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue