TomSchimansky / CustomTkinter

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

Request: ListBox #69

Open frankm1870 opened 2 years ago

frankm1870 commented 2 years ago

Hey Tom

Will you add listboxes ?

frankm1870 commented 2 years ago

After reading some of the other question, it looks like this would be very similar to the combo and text box. (in the fact you would need to deal with the scrolling) Hopefully if you figure it out for one it might work for all. Thanks for your effort this one of the best (if only) enhancements for tkinter (besides ttk).

TomSchimansky commented 2 years ago

Hi, first I will do Menu, ComboBox/MenuBox and TextBox. But after this I will focus on ListBox and Tables in general.

dambicon commented 1 year ago

Hi Tom,

While looking at the ListBox, could you then also add the ScrollBar functionality as default, just like you did to the TextBox. Please...

coolcoder613eb commented 1 year ago

Any updates?

TomSchimansky commented 1 year ago

CTkScrollabelFrame is now implemented and if you have a look at: https://github.com/TomSchimansky/CustomTkinter/blob/master/examples/scrollable_frame_example.py You can implement all kind of listboxes now, with some performance limitations if there are too many elements. But I will also add a lazy CTkListbox which will handle more items than a scrollable frame.

harryberlin commented 1 year ago

would be cool to get listbox. tried to add textboxes to scrollframes, but its not possible to mark multiple rows.

mod of scrollable_frame_example.py grafik

grafik

hachi1030-Allen commented 1 year ago

Hi @TomSchimansky

I am wondering if we have the widget for the combobox to be multiselection? My app needs that eagerly.

Let me know if you have any clue on that one.

Thanks!

DanielBooysenjr commented 1 year ago

@TomSchimansky >

It works wonders, but the destroy() method does not work on these, however place_forget() works 100s

receyuki commented 1 year ago

Hi @TomSchimansky Although CTkScrollabelFrame was implemented as an alternative to Listbox, users cannot use the cursor or shift/ctrl keys to select multiple items as they can with Listbox's MULTIPLE or EXTENDED selectmode. I would like to ask if you have any plans to implement similar functionality in ScrollabelFrame or Tables, if not, I will need to start implementing my own version.

Akascape commented 1 year ago

@frankm1870 I made this custom listbox for customtkinter: https://github.com/Akascape/CTkListbox

Droijt commented 10 months ago

I tried your CTkListbox. I like the looks off it but it is really slow when i use it with a sql query compared to the tk.listbox. do any one have any performance experience with the ctklistbox?

03bennet commented 6 months ago

Any update on CTk Listbox? I'm using tkinters listbox within CTKScrollableFrame at the moment, but when open the app on my monitor the scaling is all off on the listbox.

Akascape commented 6 months ago

@03bennet https://github.com/Akascape/CTkListbox

03bennet commented 6 months ago

Thanks @Akascape. I did try this. Looks great, but I have about 1500 entries into this listbox with a search bar to parse. The Listbox seems to have performance issues when used in this way. Any idea on how to mitigate the performance issues?

Akascape commented 6 months ago

@03bennet 1500 entries? That's a lot. Use the tkinter listbox with color customisation to match the ctk theme. That's what I would recommend. Moreover, even any other custom made widget will lag with so much widget data.

03bennet commented 6 months ago

Ha yeah. They are epsg coordinate systems and there are loads!

This is what I’ve done, which looks decent and has no performance issues. However now I have some scaling issues when moving from laptop to monitor. Only on the tkinter listbox. All custom tkinter widgets and the CTkListbox scale fine.

Akascape commented 6 months ago

@03bennet

However now I have some scaling issues when moving from laptop to monitor

You can fix this by using self._apply_widget_scaling(value) method where value can be the width/height of the listbox.

Second method is to disable the scaling using ctypes.windll.shcore.SetProcessDpiAwareness(0) but this will only work in windows and makes widget a little blurry on the edges, which is not a big issue but it can fix all the scaling problems.

03bennet commented 6 months ago

Thanks @Akascape I tried the second method and it works great

zlElo commented 6 months ago

@Akascape the problem why it's so slow is, that you're insert the objects one by one in a for loop. So the user can code the most efficient code, but it helps nothing because you're using this slow for loop. I already tried to insert round 300-400 items into the list, with a prefilled [list] and there was the speed problem exactly shown -> one by one and in the end very slow. We have to switch now back to the Tkinter Listbox with our project, if the speed problem will be not solved, although we really like your work.

Greets :)

image