Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Insert checkbutton into MListbox

by thundergnat (Deacon)
on Feb 02, 2012 at 16:13 UTC ( #951477=note: print w/ replies, xml ) Need Help??


in reply to Insert checkbutton into MListbox

I'm not familiar with Mlistbox but after a quick perusal of the docs, it look like it is based on a Listbox primitive rather than one of the tix based List widgets. (TList, Hlist, tixGrid, etc.) Listboxs are designed and optimized to work with text items. I'm not sure if it is possible to make them work with other types of items without major aggravation.

For what it is worth, here is an example Checkbuttons in a TList (which IS a tix based List widget)

#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::TList; my %tk; $tk{mw} = MainWindow->new; $tk{tlist} = $tk{mw}->TList( )->pack( -expand => 1, -fill => 'both', ); my @cbvar = ( 0, 1, 1, 0, 0 ); for ( 0 .. $#cbvar ){ $tk{"cb$_"} = $tk{tlist}->Frame; $tk{"cb$_"}->Checkbutton( -variable => \$cbvar[$_] )->pack( -side => 'left' ); $tk{"cb$_"}->Label( -text => " Checkbox $_ " )->pack( -side => 'left' ); $tk{tlist}->insert( 'end', -itemtype => 'window', -widget => $tk{"cb$_"}, ); } MainLoop;


Comment on Re: Insert checkbutton into MListbox
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951477]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-09-17 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls