You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was unable to use the scrollbar (or even bind mousewheel) to the dropdown menu as any type of button event caused the menu to withdraw. It should be noted that I only experienced this issue when using CTkScrollableDropdownFrame.
I found a fix. Though I'm not sure if it could potentially affect something else. In any case this is what worked for me:
FIX:
comment out line 27 in ctk_scrollable_dropdown_frame.py:
# self.attach.winfo_toplevel().bind("<ButtonPress>", lambda e: self._withdraw() if not self.disable else None, add="+")
If interested, I was having a hard time binding the mouse-wheel to the dropdown menu. Adding these lines to CTkScrollableDropdownFrame class after "self.frame" is created and configured is what finally worked. However, this could just be a knowledge gap on my part.
self.frame._scrollbar.grid_configure(padx=3)
########################### MODIFIED CODE ####################### This binds the mousewheel to be able to scroll in the optionmenu dropdown ## if using linuxself.frame.bind_all('<Button-4>', lambdae: self.frame._parent_canvas.yview_scroll(-1, 'units'))
self.frame.bind_all('<Button-5>', lambdae: self.frame._parent_canvas.yview_scroll(1, 'units'))
# If using windows# self.frame.bind_all('<MouseWheel>'), lambda e: self.frame._parent_canvas.yview_scroll(1, 'units))
The text was updated successfully, but these errors were encountered:
I was unable to use the scrollbar (or even bind mousewheel) to the dropdown menu as any type of button event caused the menu to withdraw. It should be noted that I only experienced this issue when using CTkScrollableDropdownFrame.
I found a fix. Though I'm not sure if it could potentially affect something else. In any case this is what worked for me:
FIX:
comment out line 27 in ctk_scrollable_dropdown_frame.py:
# self.attach.winfo_toplevel().bind("<ButtonPress>", lambda e: self._withdraw() if not self.disable else None, add="+")
If interested, I was having a hard time binding the mouse-wheel to the dropdown menu. Adding these lines to CTkScrollableDropdownFrame class after "self.frame" is created and configured is what finally worked. However, this could just be a knowledge gap on my part.
The text was updated successfully, but these errors were encountered: