Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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;

In reply to Re: Insert checkbutton into MListbox by thundergnat
in thread Insert checkbutton into MListbox by ghosh123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found