momo33 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -- use strict; use warnings; use Tkx; $Tkx::TRACE = 64; Tkx::package_require('tile'); use Tkx; my $mw = Tkx::widget->new("."); my $f_report_period = $mw->new_ttk__labelframe( -text => "report period", -labelanchor => 'nw', -relief => 'groove', -borderwidth => '5' ); my $listview = $f_report_period->new_tk__listbox( -height => 5, ); $listview->insert( "end", "T $_ and a very long text to come after that" ) for 1 .. 20; my $tree_sbv = $f_report_period->new_ttk__scrollbar( -command => [ $listview, "yview" ], -orient => "vertical" ); my $tree_sbh = $f_report_period->new_ttk__scrollbar( -command => [ $listview, "xview" ], -orient => "horizontal" ); $listview->configure( -yscrollcommand => [ $tree_sbv, "set" ] ); $listview->configure( -xscrollcommand => [ $tree_sbh, "set" ] ); $listview->g_bind("<1>" , sub{&showline}); sub showline { my @item = $listview->curselection; if ($#item==0) { print "$item[0] \n"; } } $f_report_period->g_grid( -row => 1, -column => 0, -rowspan => 2, -sticky => 'nsew' ); $b_change_year->g_grid( -row => 0, -column => 0, -columnspan => 2, -sticky => 'nsew', ); $listview->g_grid( -row => 1, -column => 0, -rowspan => 1, -sticky => 'nsew' ); $tree_sbv->g_grid( -row => 1, -column => 1, -sticky => 'ns' ); $tree_sbh->g_grid( -row => 2, -column => 0, -sticky => 'we' ); Tkx::MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: several tkx questions
by Anonymous Monk on Jul 07, 2009 at 14:23 UTC | |
by momo33 (Beadle) on Jul 07, 2009 at 15:03 UTC | |
by joeydb (Initiate) on Jul 11, 2009 at 06:04 UTC | |
by momo33 (Beadle) on Jul 14, 2009 at 06:19 UTC |