I am new in python and struggling to find a nice resizable and sortable listbox widget.
Your fancy_multilistbox example is superb, but I would like to add a column of checkboxes.
I show that in mailwasher demo of https://tktreectrl.sourceforge.net/
Is this possible in MultiListbox widget, and how can I achieve that?
An idea is to use an icon, like the one in fancy_multilistbox, that it would change upon click.
Last edit: Nikolaos S. 2022-12-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have been planning to add an extended version of the MultiListbox class to the library for some time now. It is a bit of work in progress still and basically requires further testing. There may or may not be parts of the class where some API changes might be advisable, right now I am not sure about that.
Still, I think it should be already usable as a custom widget that you could add to your own code. Among other new features it has support for checkboxes already built in.
For now I added it to the wiki's CustomClasses page at https://sourceforge.net/p/tkintertreectrl/wiki/CustomClasses/ .
The ExtMultiListbox module has some (for now) rather silly test code at the bottom, so you can run it as a standalone "program". The icons in column0 of this demo are checkboxes with custom icons, if you press F3 you should get the default checkbox icons instead. The other buttons F1-F7 should do some other more or less useful tests.
If you want to give this module a try, I would appreciate any feedback about the usability of the widget's API, and of course, in case you encounter a bug an as detailed as possible bug report.
Best regards
Michael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If it makes it it into the library there will certainly be a ScrolledExtMultiListbox class.
For now you should be able to easily set one up yourself using the ScrolledWidget class. I haven't tested this, I believe it should work though, just add this snippet to ExtMultiListbox.py right before the demo code:
classScrolledMultiListbox(ScrolledWidget):
'''ExtMultiListbox widget with one or two static or automatic scrollbars. Subwidgets are: listbox - TkTreectrl.ExtMultiListbox widget hbar - horizontal Tkinter.Scrollbar or ttk.Scrollbar vbar - vertical Tkinter.Scrollbar or ttk.Scrollbar The widget itself is a Tkinter.Frame or ttk.Frame with one additional configuration option: scrollmode - may be one of "x", "y", "both" or "auto".'''def__init__(self, *args, **kw):
ScrolledWidget.__init__(self, *args, **kw)
def_setScrolledWidget(self):
self.listbox = ExtMultiListbox(self)
returnself.listbox
Last edit: klappnase 2022-12-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It wasn't that simple, but I managed to add ScrolledExtMultiListbox class to your library, I will upload the whole code with a demo soon.
The only bug that I found, that is also common in ScrolledMultiListbox, is that if the widget starts with a vertical scrollbar shown then the first row that is visible is the second row (someone could accidentally miss the first row).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right, the ScrolledMultiListbox class should go into the ScrolledTreectrl module, sorry for that.
The vertical scrollbar problem appears to be a treectrl issue, I don't think that something is wrong with my code here. Calling yview_moveto(0.0) after creating the contents should do the trick here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for sharing.
If someone is interested, I added a new version of the ExtMultiListbox module that includes a ScrolledExtMultiListbox class to the wiki page.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new in python and struggling to find a nice resizable and sortable listbox widget.

Your fancy_multilistbox example is superb, but I would like to add a column of checkboxes.
I show that in mailwasher demo of https://tktreectrl.sourceforge.net/
Is this possible in MultiListbox widget, and how can I achieve that?
An idea is to use an icon, like the one in fancy_multilistbox, that it would change upon click.
Last edit: Nikolaos S. 2022-12-16
Hi,
I have been planning to add an extended version of the MultiListbox class to the library for some time now. It is a bit of work in progress still and basically requires further testing. There may or may not be parts of the class where some API changes might be advisable, right now I am not sure about that.
Still, I think it should be already usable as a custom widget that you could add to your own code. Among other new features it has support for checkboxes already built in.
For now I added it to the wiki's CustomClasses page at https://sourceforge.net/p/tkintertreectrl/wiki/CustomClasses/ .
The ExtMultiListbox module has some (for now) rather silly test code at the bottom, so you can run it as a standalone "program". The icons in column0 of this demo are checkboxes with custom icons, if you press F3 you should get the default checkbox icons instead. The other buttons F1-F7 should do some other more or less useful tests.
If you want to give this module a try, I would appreciate any feedback about the usability of the widget's API, and of course, in case you encounter a bug an as detailed as possible bug report.
Best regards
Michael
I am very happy reading your reply to my request so quickly. I am going to test your new module as soon as possible.
I am testing your code today. It works quite well. I am hoping for a ScrolledExtMultiListbox class.
Last edit: Nikolaos S. 2022-12-29
If it makes it it into the library there will certainly be a ScrolledExtMultiListbox class.
For now you should be able to easily set one up yourself using the ScrolledWidget class. I haven't tested this, I believe it should work though, just add this snippet to ExtMultiListbox.py right before the demo code:
Last edit: klappnase 2022-12-30
It wasn't that simple, but I managed to add ScrolledExtMultiListbox class to your library, I will upload the whole code with a demo soon.
The only bug that I found, that is also common in ScrolledMultiListbox, is that if the widget starts with a vertical scrollbar shown then the first row that is visible is the second row (someone could accidentally miss the first row).
You are right, the ScrolledMultiListbox class should go into the ScrolledTreectrl module, sorry for that.
The vertical scrollbar problem appears to be a treectrl issue, I don't think that something is wrong with my code here. Calling yview_moveto(0.0) after creating the contents should do the trick here.
The promised library with some test code.
Thanks for sharing.
If someone is interested, I added a new version of the ExtMultiListbox module that includes a ScrolledExtMultiListbox class to the wiki page.