-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkinter ListBox #43
Comments
Not really thought about it, but no reason why not! |
I am going to add This is what Im thinking:
Any thoughts, greatly received. |
Things to think about would be how the command parameter would deal with multi selection. Would it pass as argument one of the command function the selected items from the ListBox in a list? To be honest I don't think you would need a command argument for the first crack at a ListBox. If the ListBox had a selected() function that returns a list of selected items, then you could use a PushButton with the ListBox as one of the list parameter, and inside that command function linked to the button use ListBox.selected(). |
@harlekuin thanks for the input. Im not sure about the command yet either... but I think its important that there is an event that fires when the selection of a ListBox changes, it doesnt necessarily have to return anything though. Re a
e.g. to create a single select list box: lb = ListBox(app) or a multiselect listbox: lb = ListBox(app, multiselect=True) |
Ok, so update.. In regards to ListBox API. Ignoring all the stuff which ListBox will inherit from TextWidget (
|
Another thought - a problem with having a command run on selection change is that it might not match the common use case for a multi-select listbox where the user selects several options before running a function on the "finalised" selections. In the pizza toppings case, the user would be picking x out of y possible toppings, and it doesn't make sense in this case (I think) to run the command for ('cheese'), then ('cheese', 'ham') then ('cheese', 'ham', 'pineapple'). Maybe this is just an example where a button with the finalised function would make more sense. Also, would there be the listbox.value as the first argument as default of any command function? What are your thoughts on making multiselect=True as the default? not a big thing but a single-select listbox is quite similar to a combobox in use cases so I can see multi-select being used more often. will |
My thoughts for including a My choice for multiselect = False is that it is consistent with tkinter and in-line with multiline in TextBox. The |
I am thinking perhaps |
This is in dev and will be in 0.5.1 - I think the internal code will need refactoring in the future, its was surprisingly difficult to add a scrollbar to the listbox and still have it work in a "guizero" way. I think we can do better, perhaps as part of the layouts work for 0.6.0, but for the moment this is good and the API works well. |
in 0.5.1 just released |
Are there plans to add the Tkinter ListBox?
The text was updated successfully, but these errors were encountered: