http://www.tkdocs.com/tutorial/#!/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 $b_change_year = $f_report_period->new_ttk__button( -text => "change year", -command => sub { warn(@_) }, ); my $treeview = $f_report_period->new_ttk__treeview( -height => 5, ); $treeview->insert("", "end", -text => "T $_") for 1 .. 20; my $tree_sbv = $f_report_period->new_ttk__scrollbar( -command => [ $treeview, "yview" ], -orient => "vertical" ); my $tree_sbh = $f_report_period->new_ttk__scrollbar( -command => [ $treeview, "xview" ], -orient => "horizontal" ); $treeview->configure( -yscrollcommand => [ $tree_sbv, "set" ] ); $treeview->configure( -xscrollcommand => [ $tree_sbh, "set" ] ); $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', ); $treeview->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(); __END__ Tkx-1-0.0s-temp-8: package require tile Tkx-2-0.0s-temp-13: winfo children . Tkx-3-0.0s-temp-13: ttk::labelframe .l -text {report period} -labelanc +hor nw -relief groove -borderwidth 5 Tkx-4-0.0s-temp-23: winfo children .l Tkx-5-0.0s-temp-23: ttk::button .l.b -text {change year} -command perl +::callback Tkx-6-0.0s-temp-25: winfo children .l Tkx-7-0.0s-temp-25: ttk::treeview .l.t -height 5 Tkx-8-0.0s-temp-29: .l.t insert end -text {T 1} Tkx-9-0.0s-temp-29: .l.t insert end -text {T 2} Tkx-10-0.0s-temp-29: .l.t insert end -text {T 3} Tkx-11-0.0s-temp-29: .l.t insert end -text {T 4} Tkx-12-0.0s-temp-29: .l.t insert end -text {T 5} Tkx-13-0.0s-temp-29: .l.t insert end -text {T 6} Tkx-14-0.0s-temp-29: .l.t insert end -text {T 7} Tkx-15-0.0s-temp-29: .l.t insert end -text {T 8} Tkx-16-0.0s-temp-29: .l.t insert end -text {T 9} Tkx-17-0.0s-temp-29: .l.t insert end -text {T 10} Tkx-18-0.0s-temp-29: .l.t insert end -text {T 11} Tkx-19-0.0s-temp-29: .l.t insert end -text {T 12} Tkx-20-0.0s-temp-29: .l.t insert end -text {T 13} Tkx-21-0.0s-temp-29: .l.t insert end -text {T 14} Tkx-22-0.0s-temp-29: .l.t insert end -text {T 15} Tkx-23-0.0s-temp-29: .l.t insert end -text {T 16} Tkx-24-0.0s-temp-29: .l.t insert end -text {T 17} Tkx-25-0.0s-temp-29: .l.t insert end -text {T 18} Tkx-26-0.0s-temp-29: .l.t insert end -text {T 19} Tkx-27-0.0s-temp-29: .l.t insert end -text {T 20} Tkx-28-0.0s-temp-32: winfo children .l Tkx-29-0.0s-temp-32: ttk::scrollbar .l.s -command [list .l.t yview] -o +rient vertical Tkx-30-0.0s-temp-36: winfo children .l Tkx-31-0.0s-temp-36: ttk::scrollbar .l.s2 -command [list .l.t xview] - +orient horizontal Tkx-32-0.0s-temp-40: .l.t configure -yscrollcommand [list .l.s set] Tkx-33-0.0s-temp-41: .l.t configure -xscrollcommand [list .l.s2 set] Tkx-34-0.0s-temp-43: grid .l -row 1 -column 0 -rowspan 2 -sticky nsew Tkx-35-0.0s-temp-50: grid .l.b -row 0 -column 0 -columnspan 2 -sticky +nsew Tkx-36-0.0s-temp-57: grid .l.t -row 1 -column 0 -rowspan 1 -sticky nse +w Tkx-37-0.0s-temp-65: grid .l.s -row 1 -column 1 -sticky ns Tkx-38-0.0s-temp-71: grid .l.s2 -row 2 -column 0 -sticky we
In reply to Re: Tkx grid problem
by Anonymous Monk
in thread Tkx grid problem
by momo33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |