473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

putting checkbuttons in a listbox

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/Coo...n/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?
Dec 21 '05 #1
1 1430
valen1260 wrote:
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/Coo...n/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

Dec 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Frank Chen | last post by:
Hi: The attahced file is an example that confuses me. When executing test.py and then click menu, you can see the menu constitutes 'New Window', 'Open File', and an activated checkbutton,...
0
by: William Gill | last post by:
OK I'm tired, I've got a cold, and my brain isn't working very well. I have a result set ( a tuple of tuples) from a db. Each element has two elements; classification number, and classification...
4
by: Lou G | last post by:
I'm trying to show a number of Checkbuttons (each with associated text based on a list of names) inside a y-scrollable Text widget like so: Bob Carol Ted Alice etc. etc.
2
by: Gigs_ | last post by:
from Tkinter import * states = def onpress(i): states = not states root = Tk() for i in range(10):
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.