Refactored adding right click menu, sped up reads with timeouts, fix for right click menus
This commit is contained in:
parent
80cfdbcf3d
commit
d67a999d05
138
PySimpleGUI.py
138
PySimpleGUI.py
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
from wx import Font
|
from wx import Font
|
||||||
|
|
||||||
version = __version__ = "4.31.0.2 Unreleased\nChange Menu & ButtonMenu color and font default, renamed & refactored from FlexForm to Window in ConvertFlexToTK, Button.update now checks for COLOR_SYSTEM_DEFAULT"
|
version = __version__ = "4.31.0.3 Unreleased\nChange Menu & ButtonMenu color and font default, renamed & refactored from FlexForm to Window in ConvertFlexToTK, Button.update now checks for COLOR_SYSTEM_DEFAULT, fix for DisabledText missing for right click menus, made reads faster when timeout happens, refactored adding right click menu"
|
||||||
|
|
||||||
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
||||||
|
|
||||||
|
@ -693,8 +693,10 @@ class Element():
|
||||||
self.user_bind_dict = {} # Used when user defines a tkinter binding using bind method - convert bind string to key modifier
|
self.user_bind_dict = {} # Used when user defines a tkinter binding using bind method - convert bind string to key modifier
|
||||||
self.user_bind_event = None # Used when user defines a tkinter binding using bind method - event data from tkinter
|
self.user_bind_event = None # Used when user defines a tkinter binding using bind method - event data from tkinter
|
||||||
self.pad_used = (0,0) # the amount of pad used when was inserted into the layout
|
self.pad_used = (0,0) # the amount of pad used when was inserted into the layout
|
||||||
|
if not hasattr(self, 'DisabledTextColor'):
|
||||||
|
self.DisabledTextColor = None
|
||||||
|
if not hasattr(self, 'ItemFont'):
|
||||||
|
self.ItemFont = None
|
||||||
|
|
||||||
def _RightClickMenuCallback(self, event):
|
def _RightClickMenuCallback(self, event):
|
||||||
"""
|
"""
|
||||||
|
@ -7705,6 +7707,8 @@ class Window:
|
||||||
results = self._read(timeout=timeout, timeout_key=timeout_key)
|
results = self._read(timeout=timeout, timeout_key=timeout_key)
|
||||||
# Post processing for Calendar Chooser Button
|
# Post processing for Calendar Chooser Button
|
||||||
try:
|
try:
|
||||||
|
if results[0] == timeout_key: # if a timeout, then not a calendar button
|
||||||
|
break
|
||||||
elem = self.find_element(results[0], silent_on_error=True) # get the element that caused the event
|
elem = self.find_element(results[0], silent_on_error=True) # get the element that caused the event
|
||||||
if elem.Type == ELEM_TYPE_BUTTON:
|
if elem.Type == ELEM_TYPE_BUTTON:
|
||||||
if elem.BType == BUTTON_TYPE_CALENDAR_CHOOSER:
|
if elem.BType == BUTTON_TYPE_CALENDAR_CHOOSER:
|
||||||
|
@ -11047,11 +11051,8 @@ def AddMenuItem(top_menu, sub_menu_info, element, is_sub_menu=False, skip=False)
|
||||||
new_menu.config(fg=element.TextColor)
|
new_menu.config(fg=element.TextColor)
|
||||||
if element.DisabledTextColor not in (COLOR_SYSTEM_DEFAULT, None):
|
if element.DisabledTextColor not in (COLOR_SYSTEM_DEFAULT, None):
|
||||||
new_menu.config(disabledforeground=element.DisabledTextColor)
|
new_menu.config(disabledforeground=element.DisabledTextColor)
|
||||||
try: # if the element has an item font specified, use it. Some may not have variable
|
if element.ItemFont is not None:
|
||||||
if element.ItemFont is not None:
|
new_menu.config(font=element.ItemFont)
|
||||||
new_menu.config(font=element.ItemFont)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return_val = new_menu
|
return_val = new_menu
|
||||||
pos = sub_menu_info[i].find('&')
|
pos = sub_menu_info[i].find('&')
|
||||||
if pos != -1:
|
if pos != -1:
|
||||||
|
@ -11210,6 +11211,13 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _add_right_click_menu(element):
|
||||||
|
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
||||||
|
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
||||||
|
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
||||||
|
AddMenuItem(top_menu, menu[1], element)
|
||||||
|
element.TKRightClickMenu = top_menu
|
||||||
|
element.Widget.bind('<Button-3>', element._RightClickMenuCallback)
|
||||||
|
|
||||||
tclversion_detailed = tkinter.Tcl().eval('info patchlevel')
|
tclversion_detailed = tkinter.Tcl().eval('info patchlevel')
|
||||||
|
|
||||||
|
@ -11368,12 +11376,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
# element.TKColFrame.configure(background=element.BackgroundColor,
|
# element.TKColFrame.configure(background=element.BackgroundColor,
|
||||||
# highlightbackground=element.BackgroundColor,
|
# highlightbackground=element.BackgroundColor,
|
||||||
# highlightcolor=element.BackgroundColor)
|
# highlightcolor=element.BackgroundColor)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKColFrame.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
if element.Grab:
|
if element.Grab:
|
||||||
element._grab_anywhere_on()
|
element._grab_anywhere_on()
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
|
@ -11464,12 +11467,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
tktext_label.bind('<Button-1>', element._TextClickedHandler)
|
tktext_label.bind('<Button-1>', element._TextClickedHandler)
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKText, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKText, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
tktext_label.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
if element.Grab:
|
if element.Grab:
|
||||||
element._grab_anywhere_on()
|
element._grab_anywhere_on()
|
||||||
# ------------------------- BUTTON placement element non-ttk version ------------------------- #
|
# ------------------------- BUTTON placement element non-ttk version ------------------------- #
|
||||||
|
@ -11800,12 +11798,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
|
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKEntry, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKEntry, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKEntry.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
|
|
||||||
# ------------------------- COMBO placement element ------------------------- #
|
# ------------------------- COMBO placement element ------------------------- #
|
||||||
|
@ -11977,12 +11970,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKListbox, text=element.Tooltip,
|
element.TooltipObject = ToolTip(element.TKListbox, text=element.Tooltip,
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKListbox.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# ------------------------- MULTILINE placement element ------------------------- #
|
# ------------------------- MULTILINE placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_INPUT_MULTILINE:
|
elif element_type == ELEM_TYPE_INPUT_MULTILINE:
|
||||||
element = element # type: Multiline
|
element = element # type: Multiline
|
||||||
|
@ -12036,12 +12024,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.reroute_cprint:
|
if element.reroute_cprint:
|
||||||
cprint_set_output_destination(toplevel_form, element.Key)
|
cprint_set_output_destination(toplevel_form, element.Key)
|
||||||
|
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKText.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
# ------------------------- CHECKBOX pleacement element ------------------------- #
|
# ------------------------- CHECKBOX pleacement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_INPUT_CHECKBOX:
|
elif element_type == ELEM_TYPE_INPUT_CHECKBOX:
|
||||||
|
@ -12199,12 +12183,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
element._TKOut.frame.pack_forget()
|
element._TKOut.frame.pack_forget()
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element._TKOut, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element._TKOut, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element._TKOut.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
# ------------------------- IMAGE placement element ------------------------- #
|
# ------------------------- IMAGE placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_IMAGE:
|
elif element_type == ELEM_TYPE_IMAGE:
|
||||||
|
@ -12224,11 +12203,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
else:
|
else:
|
||||||
width, height = element_size
|
width, height = element_size
|
||||||
if photo is not None:
|
if photo is not None:
|
||||||
element.tktext_label = element.Widget = tk.Label(tk_row_frame, image=photo, width=width,
|
element.tktext_label = tk.Label(tk_row_frame, image=photo, width=width,
|
||||||
height=height,
|
height=height,
|
||||||
bd=border_depth)
|
bd=border_depth)
|
||||||
else:
|
else:
|
||||||
element.tktext_label = element.Widget = tk.Label(tk_row_frame, width=width, height=height,
|
element.tktext_label = tk.Label(tk_row_frame, width=width, height=height,
|
||||||
bd=border_depth)
|
bd=border_depth)
|
||||||
|
|
||||||
if not element.BackgroundColor in (None, COLOR_SYSTEM_DEFAULT):
|
if not element.BackgroundColor in (None, COLOR_SYSTEM_DEFAULT):
|
||||||
|
@ -12245,18 +12224,16 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.EnableEvents:
|
if element.EnableEvents:
|
||||||
element.tktext_label.bind('<ButtonPress-1>', element._ClickHandler)
|
element.tktext_label.bind('<ButtonPress-1>', element._ClickHandler)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
element.Widget = element.tktext_label
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
_add_right_click_menu(element)
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.tktext_label.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# ------------------------- Canvas placement element ------------------------- #
|
# ------------------------- Canvas placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_CANVAS:
|
elif element_type == ELEM_TYPE_CANVAS:
|
||||||
element = element # type: Canvas
|
element = element # type: Canvas
|
||||||
width, height = element_size
|
width, height = element_size
|
||||||
if element._TKCanvas is None:
|
if element._TKCanvas is None:
|
||||||
element._TKCanvas = element.Widget = tk.Canvas(tk_row_frame, width=width, height=height,
|
element._TKCanvas = tk.Canvas(tk_row_frame, width=width, height=height,
|
||||||
bd=border_depth)
|
bd=border_depth)
|
||||||
else:
|
else:
|
||||||
element._TKCanvas.master = tk_row_frame
|
element._TKCanvas.master = tk_row_frame
|
||||||
|
@ -12268,12 +12245,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element._TKCanvas, text=element.Tooltip,
|
element.TooltipObject = ToolTip(element._TKCanvas, text=element.Tooltip,
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
element.Widget = element._TKCanvas
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
_add_right_click_menu(element)
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element._TKCanvas.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# ------------------------- Graph placement element ------------------------- #
|
# ------------------------- Graph placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_GRAPH:
|
elif element_type == ELEM_TYPE_GRAPH:
|
||||||
element = element # type: Graph
|
element = element # type: Graph
|
||||||
|
@ -12302,12 +12276,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
element._TKCanvas2.bind('<ButtonPress-1>', element.ButtonPressCallBack)
|
element._TKCanvas2.bind('<ButtonPress-1>', element.ButtonPressCallBack)
|
||||||
if element.DragSubmits:
|
if element.DragSubmits:
|
||||||
element._TKCanvas2.bind('<Motion>', element.MotionCallBack)
|
element._TKCanvas2.bind('<Motion>', element.MotionCallBack)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element._TKCanvas2.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# ------------------------- MENU placement element ------------------------- #
|
# ------------------------- MENU placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_MENUBAR:
|
elif element_type == ELEM_TYPE_MENUBAR:
|
||||||
element = element # type: MenuBar
|
element = element # type: MenuBar
|
||||||
|
@ -12378,12 +12347,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
labeled_frame.configure(borderwidth=element.BorderWidth)
|
labeled_frame.configure(borderwidth=element.BorderWidth)
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(labeled_frame, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(labeled_frame, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
labeled_frame.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# row_should_expand=True
|
# row_should_expand=True
|
||||||
# ------------------------- Tab placement element ------------------------- #
|
# ------------------------- Tab placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_TAB:
|
elif element_type == ELEM_TYPE_TAB:
|
||||||
|
@ -12413,12 +12378,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKFrame, text=element.Tooltip,
|
element.TooltipObject = ToolTip(element.TKFrame, text=element.Tooltip,
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKFrame.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
# ------------------------- TabGroup placement element ------------------------- #
|
# ------------------------- TabGroup placement element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_TAB_GROUP:
|
elif element_type == ELEM_TYPE_TAB_GROUP:
|
||||||
|
@ -12640,12 +12601,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip,
|
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip,
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKTreeview.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
|
|
||||||
if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH:
|
if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH:
|
||||||
print('*** tk version 8.6.9 detected.... patching ttk treeview code ***')
|
print('*** tk version 8.6.9 detected.... patching ttk treeview code ***')
|
||||||
|
@ -12762,12 +12718,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.Tooltip is not None: # tooltip
|
if element.Tooltip is not None: # tooltip
|
||||||
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip,
|
element.TooltipObject = ToolTip(element.TKTreeview, text=element.Tooltip,
|
||||||
timeout=DEFAULT_TOOLTIP_TIME)
|
timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.TKTreeview.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH:
|
if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH:
|
||||||
print('*** tk version 8.6.9 detected.... patching ttk treeview code ***')
|
print('*** tk version 8.6.9 detected.... patching ttk treeview code ***')
|
||||||
tree_style.map(style_name,
|
tree_style.map(style_name,
|
||||||
|
@ -12845,12 +12797,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
tktext_label.bind('<Button-1>', element._TextClickedHandler)
|
tktext_label.bind('<Button-1>', element._TextClickedHandler)
|
||||||
if element.Tooltip is not None:
|
if element.Tooltip is not None:
|
||||||
element.TooltipObject = ToolTip(element.TKText, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
element.TooltipObject = ToolTip(element.TKText, text=element.Tooltip, timeout=DEFAULT_TOOLTIP_TIME)
|
||||||
if element.RightClickMenu or toplevel_form.RightClickMenu:
|
_add_right_click_menu(element)
|
||||||
menu = element.RightClickMenu or toplevel_form.RightClickMenu
|
|
||||||
top_menu = tk.Menu(toplevel_form.TKroot, tearoff=False)
|
|
||||||
AddMenuItem(top_menu, menu[1], element)
|
|
||||||
element.TKRightClickMenu = top_menu
|
|
||||||
element.Widget.bind('<Button-3>', element._RightClickMenuCallback)
|
|
||||||
# ............................DONE WITH ROW pack the row of widgets ..........................#
|
# ............................DONE WITH ROW pack the row of widgets ..........................#
|
||||||
# done with row, pack the row of widgets
|
# done with row, pack the row of widgets
|
||||||
# tk_row_frame.grid(row=row_num+2, sticky=tk.NW, padx=DEFAULT_MARGINS[0])
|
# tk_row_frame.grid(row=row_num+2, sticky=tk.NW, padx=DEFAULT_MARGINS[0])
|
||||||
|
|
Loading…
Reference in New Issue