TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.6k stars 1.09k forks source link

combobox/optionmenu scroll bar? #253

Open Azuremoon13 opened 2 years ago

Azuremoon13 commented 2 years ago

Discussed in https://github.com/TomSchimansky/CustomTkinter/discussions/249

is it possible to have like a default tkinter scroll bar for these items?if so any examples? also how do i stop these when clicked on taking up the full size of my screen?

TomSchimansky commented 2 years ago

Are you using Linux? On Windows and macOS the tkinter menu which is used for the dropdown menu has some sort of scrolling, but not on Linux for some reason. I will have a look if its possible to maybe use a tsk menu or something.

Azuremoon13 commented 2 years ago

no im on windows, and yes it has 2 arrows top and bottom of the dropdown.. but was wondering if you could attach an actual scroll bar? also is there a way to set fixed height of the dropdown when its opened? as if you have a lot its spans the whole screen

TomSchimansky commented 2 years ago

As far as I can see there is no option to set the max height for a tkinter menu: https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/menu.html https://stackoverflow.com/questions/30027138/how-to-get-set-menu-widget-height

Azuremoon13 commented 2 years ago

oh yea.. i think i might have to swap to a combo box then as you can limit them.. possible to add from your end to dropdowns too?

wojas007 commented 2 years ago

Hello, The regular drop-down menu has limited options. TKinter also has combobox which look much better in some cases. The current combobox in CTk doesn't look good for longer lists ; /

GGTEC commented 2 years ago

hello, In the ttk has the option to limit the height of combobox or optionmenu maybe you can see that using the ttk as an example. thanks for the incredible work!

Akascape commented 1 year ago

@Azuremoon13 @GGTEC @wojas007 Here is a custom made menu with scrollable options: https://github.com/Akascape/CTkScrollableDropdown

It is easy to use, just attach the name of the combobox/optionmenu.

AnonymousVibrate commented 5 months ago

@Azuremoon13 @GGTEC @wojas007 Here is a custom made menu with scrollable options: https://github.com/Akascape/CTkScrollableDropdown

It is easy to use, just attach the name of the combobox/optionmenu.

Why this scrollable Dropdown is so laggy when there is like 50 items to choose? Is it just me ?

jnd-github commented 2 months ago

@AnonymousVibrate I have the same problem, just started playing with it because i also have a list of around that length to chose from. It also happens to not properly show the selected item (keeps showing default/first item at least some times), even though the command is executed with the correct argument)