Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Regarding Perl/Tk

by sammy_01 (Initiate)
on Jun 27, 2013 at 05:21 UTC ( #1040917=note: print w/ replies, xml ) Need Help??


in reply to Re: Regarding Perl/Tk
in thread Regarding Perl/Tk

Here is the complete code. Click on the "FSDB Configuration" tab.

Here i am unable to get the 3 button's in a new line

#!/usr/bin/perl use Tk; use Tk::Text; use Tk::BrowseEntry; use Tk::DirTree; use Tk::NoteBook; use File::Basename; my %manager_hash = ( "all" => "Sheet 2", "fsdb" => "Sheet 3", ); ###################################################################### +################## ##################################### MAIN GUI ###################### +################## ###################################################################### +################## my $mw = MainWindow->new(-title=>"FSDB And Manager Launcher"); $mw->geometry( "900x270" ); #### Creating the tabs in the GUI my $book = $mw->NoteBook()->pack( -fill=>'both', -expand=>1 ); my $select = $book->add( "Sheet 1", -label=>"Manager Selection", -crea +tecmd=>\&create_managerTab ); my $all_tab = $book->add( "Sheet 2", -label=>"All configuration", -cre +atecmd=>\&getAllTab, -state=> 'normal' ); my $fsdb_tab = $book->add( "Sheet 3", -label=>"FSDB configuration", -c +reatecmd=>\&getMainTab, -state=>'normal' ); MainLoop; ###################################################################### +################## ##################################### GUI Functions ################## +################## ###################################################################### +################## sub create_managerTab { #### Radio buttons for Manager selection $frm_manager = $select -> Frame(-borderwidth => '3', -relief => 'r +idge') ->pack(); $lbl_manager = $frm_manager-> Label(-text=>"SELECT THE MANAGER'S T +O RUN: ")->pack(-side => 'left'); $manager = "all"; $rd_all = $frm_manager -> Radiobutton(-text=>"All", -value=>"all", -variable=>\$manager)->pack(-side => 'left' +, -expand => 'y'); $rd_fsdb = $frm_manager -> Radiobutton(-text=>"FSDB", -value=>"fsdb", -variable=>\$manager)->pack(-side => 'left +', -expand => 'y'); $select->Button( -text=>'OK', -command=>\&enableTab, -font => 'Times 12', -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -width => 20, -borderwidth => 5)->pack(); $select->Button( -text=>'Exit', -command=>sub { $mw->destroy; exit; }, -font => 'Times 12', -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -width => 20, -borderwidth => 5 )->pack(); } ################################################################# # This function is used to enable/popup the perticluar tab # # selected in the "Manager selection" tab # ################################################################# sub enableTab { print "MANAGER ===> $manager\n"; $book->raise("$manager_hash{$manager}"); } sub getMainTab { #### Label & Entry creation to select the test path $frm_name = $fsdb_tab -> Frame()->pack(-side => 'left', -fill => ' +both', -anchor => 'n'); $lab = $frm_name -> Label(-text=>"TEST PATH:")->pack(-side => 'lef +t'); $ent = $frm_name -> Entry(-width=>80)->pack(-side => 'left'); $ent->focus; #GUI building for Browser push buttons $but= $frm_name -> Button( -text=>"Browse", -command =>\&browser_button, -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -borderwidth =>8 )->pack(-side => 'right'); #### Button for "Run FSDB" $final_frame = $fsdb_tab -> Frame(-borderwidth => '5', -relief => +'ridge')->pack(); $run_fsdb = $final_frame -> Button( -text=>"Run FSDB", -command => \&run_fsdb, -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -borderwidth => 8, -width => 10 )->pack(-side => 'left', -expand => 0); #### Button for "Refresh" $refresh_frame = $fsdb_tab -> Frame(-borderwidth => '5', -relief = +> 'ridge')->pack(); $refresh_fsdb = $refresh_frame -> Button( -text=>"Refresh", -command => \&refresh_fsdb, -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -borderwidth => 8, -width => 10 )->pack(-side => 'left', -expand => 0); #### Button for "EXIT" $exit_frame = $fsdb_tab -> Frame(-borderwidth => '5', -relief => ' +ridge')->pack(); $exit_fsdb = $exit_frame -> Button( -text=>"EXIT", -command => sub { $mw->destroy; exit; }, -activebackground => 'lightblue', -activeforeground => 'black', -relief => 'raised', -borderwidth => 10, -width => 10 )->pack(-side => 'right'); }
Sammy..


Comment on Re^2: Regarding Perl/Tk
Download Code
Re^3: Regarding Perl/Tk
by Anonymous Monk on Jun 27, 2013 at 07:40 UTC
    The technique thundergnat demonstrated is to use a container widget(Frame) with a grid sizer (or whatever), so just copy/paste that and you're good to go

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2015-07-06 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls