momo33 has asked for the wisdom of the Perl Monks concerning the following question:
#!/opt/ActivePerl-5.10/bin/perl use Tkx; $Tkx::TRACE = 64; Tkx::package_require('tile'); my $mw = Tkx::widget->new("."); my $f = $mw->new_ttk__labelframe( -text => "frame", -labelanchor => 'nw' ); my $b = $f->new_ttk__button( -text => "button", ); my $l = $f->new_tk__listbox( -height => 5, -width => 20 ); my $lv = $f->new_ttk__scrollbar( -command => [ $l, "yview" ], -orient => "vertical" ); my $lh = $f->new_ttk__scrollbar( -command => [ $l, "xview" ], -orient => "horizontal" ); $l->configure( -yscrollcommand => [ $lv, "set" ] ); $l->configure( -xscrollcommand => [ $lh, "set" ] ); $f->g_grid( -row => 0, -column => 0, -rowspan => 2, -columnspan => 2, -sticky => 'nsew' ); $f->g_grid_columnconfigure( 0, -weight => 1 ); $f->g_grid_rowconfigure( 1, -weight => 1 ); $b->g_grid( -row => 0, -column => 0, -sticky => 'ew' ); $b->g_grid_columnconfigure( 0, -weight => 1 ); $l->g_grid( -row => 1, -column => 0, -sticky => 'nsew' ); $l->g_grid_columnconfigure( 0, -weight => 1 ); $l->g_grid_rowconfigure( 1, -weight => 1 ); $lv->g_grid( -row => 1, -column => 1, -sticky => 'ns' ); $lv->g_grid_rowconfigure( 1, -weight => 1 ); $lh->g_grid( -row => 2, -column => 0, -sticky => 'ew' ); $mw->g_grid_columnconfigure( 0, -weight => 1, -minsize => 20 ); $mw->g_grid_rowconfigure( 0, -weight => 1, -minsize => 20 ); for (my $i=0; $i<10; $i++) { $l->insert("end", "$i: this is a very long line $i of 10"); } Tkx::MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: resizable listbox in Tkx?
by Anonymous Monk on Jul 18, 2009 at 14:40 UTC | |
by momo33 (Beadle) on Jul 18, 2009 at 15:36 UTC | |
by Anonymous Monk on Jul 18, 2009 at 16:11 UTC |