putting checkbuttons in a listbox

Discussion in 'Python' started by valen1260, Dec 20, 2005.

  1. valen1260

    valen1260 Guest

    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?
     
    valen1260, Dec 20, 2005
    #1
    1. Advertising

  2. 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/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
     
    Martin Franklin, Dec 21, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saurabh
    Replies:
    6
    Views:
    4,618
    Chris Smith
    May 30, 2004
  2. Frank Chen
    Replies:
    3
    Views:
    536
    Cameron Laird
    Oct 8, 2003
  3. William Gill

    a list of Checkbuttons

    William Gill, Aug 30, 2005, in forum: Python
    Replies:
    0
    Views:
    300
    William Gill
    Aug 30, 2005
  4. Lou G

    Checkbuttons in a Text widget

    Lou G, Feb 17, 2006, in forum: Python
    Replies:
    4
    Views:
    327
    Lou G
    Feb 17, 2006
  5. Gigs_
    Replies:
    2
    Views:
    361
    Eric Brunel
    Feb 21, 2007
Loading...

Share This Page