putting checkbuttons in a listbox

V

valen1260

I'd like to have a multicolumn listbox, with one column being a list of
items and the other being a list of checkbuttons. The user could check
his "favorites" and then shorten the list to show only the checked items.

I have implemented the MultiListbox at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 . I then
tried attaching the checkbuttons to a listbox object. To get them to
display, I had to pack them, but in packing them, they just disregard
the scrollable listbox and take as much room as needed.

Has anyone implemented anything like this? Is there a way to put
checkbuttons in a fixed-height, scrollable listbox or similar structure?
 
M

Martin Franklin

valen1260 said:
I'd like to have a multicolumn listbox, with one column being a list of
items and the other being a list of checkbuttons. The user could check
his "favorites" and then shorten the list to show only the checked items.

I have implemented the MultiListbox at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52266 . I then
tried attaching the checkbuttons to a listbox object. To get them to
display, I had to pack them, but in packing them, they just disregard
the scrollable listbox and take as much room as needed.

Has anyone implemented anything like this? Is there a way to put
checkbuttons in a fixed-height, scrollable listbox or similar structure?


snipped from the above recipe :-


"""
Discussion:

The resulting widget is lightweight, fast, and very easy to use. The main
limitation is that only text is supported which is a fundamental limitation
of the Listbox.

In this implementation, only single-selection is allowed but it could be
extended to multiple selection. User-resizeable columns and auto-sorting by
clicking on the column label should also be possible.

Auto-scrolling while dragging Button-1 was disabled because this was breaks
the synchronization between the lists. However, scrolling with Button-2
works
fine.
"""


so you cannot put anything other than text into a standard Tk Listbox
however you could try using a non-standard table widget see here for
more details :-

http://tkinter.unpythonic.net/wiki/Widgets


Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Checkbuttons in a Text widget 4
listbox 0
Tkinter: using a Listbox 1
Adding a DB regs to a wx listbox 1
deselect an iterm in ListBox wxPython 1
select listbox 1
array to listbox 18
I have a problem with listbox 0

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top