#!perl -w use strict; use Tk; use Tk::Label; use Tk::Text; use Tk::Button; use Tk::FBox; my $Type_P4SM = [ [ 'P4SM', '.p4sm' ] ]; my $File_P4SM; my $mw=MainWindow->new(-title=>'UpdateP4SM'); my $w_Lab_Step1 = $mw -> Label ( -justify=>'left', -relief=>'flat', -text=>'Copy/Paste Commit Log from P4 to here:' ) -> grid(-row=>0, -columnspan=>3, -column=>0, -sticky=>'nw'); my $w_Text_Commit = $mw -> Scrolled ( 'Text', -state=>'normal', -relief=>'sunken', -scrollbars=>'se', -wrap=>'none' ) -> grid(-row=>1, -columnspan=>3, -column=>0, -sticky=>'nw'); my $w_Lab_Step2 = $mw -> Label ( -justify=>'left', -relief=>'flat', -text=>'P4SM file to update:' ) -> grid(-row=>2, -column=>0, -sticky=>'nw'); my $w_Button_P4SM = $mw -> Button ( -overrelief=>'raised', -command=>\&Show_Open_P4SM, -width=>20, -state=>'normal', -relief=>'raised', -compound=>'none', -textvariable=>\$File_P4SM ) -> grid(-row=>2, -column=>1, -sticky=>'nwe'); my $w_FBox_P4SM = $w_Button_P4SM -> FBox ( -title=>'Select P4SM to Update', -filetypes=>$Type_P4SM, -type=>'open' ); my $w_Button_Update = $mw -> Button ( -overrelief=>'raised', -command=>\&updateP4SM, -state=>'normal', -relief=>'raised', -text=>'Update', -compound=>'none' ) -> grid(-row=>3, -column=>1, -sticky=>'new'); my $w_Button_Quit = $mw -> Button ( -overrelief=>'raised', -command=>\&Quit, -state=>'normal', -relief=>'raised', -text=>'Quit', -compound=>'none' ) -> grid(-row=>4, -column=>2, -sticky=>'ne'); MainLoop; sub Show_Open_P4SM { # $File_P4SM = $mw->getOpenFile( -title=>'Select P4SM to Update', -filetypes=>$Type_P4SM ); $File_P4SM = $w_FBox_P4SM->Show(); } sub updateP4SM { print "Updating $File_P4SM....\n"; } sub Quit { Tk::exit; }