in reply to Re: Open a file using Tkx package
in thread Open a file using Tkx package
use strict; use Tkx; use constant TRUE => 1; use constant FALSE => 0; #Defining UI components. our $iteration = 0; our $mw = Tkx::widget->new("."); $mw->g_wm_title("G7 Fiery."); $mw->g_wm_minsize(300, 300); #our $filename = Tkx::tk__getOpenFile(); our $frame = $mw->new_ttk__frame( -padding => "3 3 12 12"); our $label1 = $mw->new_ttk__label(-text => "Iteration"); our $label2 = $mw->new_ttk__label(-textvariable => \$iteration); our $cb = $frame->new_ttk__button(-text => "Calculate", -command => su +b {calculate();}); our $cb1 = $frame->new_ttk__button(-text => "open", -command => sub {g +et_source_filename();}); #Placing objects . $frame->g_grid(-column => 0, -row => 0, -sticky => "nwes"); $cb->g_grid(-column => 3, -row => 3, -sticky => "w"); $cb1->g_grid(-column => 2, -row => 3, -sticky => "e"); $label1->g_grid(-column => 2, -row => 1, -sticky => "w"); $label2->g_grid(-column => 3, -row => 1, -sticky => "w"); $mw->g_grid_columnconfigure(0, -weight => 1); $mw->g_grid_rowconfigure(0, -weight => 1); foreach (Tkx::SplitList($frame->g_winfo_children)) { Tkx::grid_configure($_, -padx => 5, -pady => 5); } sub calculate() { $iteration ++; } sub get_source_filename { $source_file = Tkx::tk___getOpenFile(); } Tkx::MainLoop;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Open a file using Tkx package
by bugged123 (Initiate) on Nov 21, 2011 at 18:50 UTC | |
Re^3: Open a file using Tkx package
by Anonymous Monk on Nov 21, 2011 at 18:49 UTC | |
by Anonymous Monk on Nov 21, 2011 at 19:07 UTC | |
by bugged123 (Initiate) on Nov 21, 2011 at 19:09 UTC |