From: Chris E. <ce...@mi...> - 2001-05-11 13:26:46
|
yes.=20 Here is the code. It's messy, but commented ... use Win32::GUI; #($DOS) =3D Win32::GUI::GetPerlWindow(); # Win32::GUI::Hide($DOS); # this is basically a test to learn Win32::GUI my $Toolbar=3DWin32::GUI::Window->new( -name=3D>'Toolbar', -size=3D>[600,75], -title=3D>"PERL ToolBar", ); # launcher button on main bar my $launcher=3D$Toolbar->AddButton( -name=3D>'launcher', -pos=3D>[10,10], -text=3D>"Launcher", ); $Toolbar->launcher->Show(); #launch the launcher panel and create panel as separate window #this is where I can type a command in and run it directly from <STDIN> sub launcher_Click{ my $Launcher=3DWin32::GUI::Window->new(=20 -name=3D>'CommandLauncher', -size=3D>[200,75], -title=3D>"Launcher", ); $Launcher->Show(); my $textfield=3D$Launcher->AddTextfield( -name=3D>'CommandBox', -background=3D>[255,255,0], -pos=3D>[10,10], -size=3D>[150,22], ); #run button on launcher window my $runButton-$Launcher->AddButton( -name=3D>'runbutton', -pos=3D>[160,10], -text=3D>'Run', -size=3D>[30,22], ); $Launcher->runbutton->Show(); # this executes the user input of $textfield=20 sub runbutton_Click{ exec($textfield->Text); } } my $NotePadButton=3D$Toolbar->AddButton( -name=3D>'notepad', -pos=3D>[75,10], -text=3D>'notepad', ); =20 $Toolbar->notepad->Show(); sub notepad_Click{ exec("notepad.exe"); } #exit the program. This is a test to figure out how to keep the=20 #toolbar floating without exiting on button_Click.=20 my $ExitButton=3D$Toolbar->AddButton( -name=3D>'Exit', -pos=3D>[150,10], -text=3D>'Exit Toolbar', ); =20 sub Exit_Click { exit; } =20 $Toolbar->Show(); Win32::GUI::Dialog(); # commented this out trying to troubleshoot=20 # sub Toolbar_Terminate{ # -1; # } =20 ----- Original Message -----=20 From: Peter Eisengrein=20 To: 'per...@li...'=20 Sent: Friday, May 11, 2001 7:31 AM Subject: RE: [perl-win32-gui-users] keeping a window open Do you have the Win::GUI::Dialog(); statement in there? =20 =20 -----Original Message----- From: Chris Etzel [mailto:ce...@mi...] Sent: Thursday, May 10, 2001 8:03 PM To: per...@li... Subject: [perl-win32-gui-users] keeping a window open Ok, it may be that I have hacking at my script so long I am = cross-eyed, but it is too much fun to stop now. I figured the best way = to learn the Win32::GUI was to write a cool little toolbar with a couple = of my most used apps on it. It floats and brings up my apps like it = should, but it closes after I click the button for the app. How do I = keep the script open until I exit it manually?=20 I have an exit button but for the life of me I can't figure out how = to tell it=20 unless I click EXIT, stay open. I will kick myself in advance in case this is a basic perl coding = issue and not a Win32gui issue. Thanks,=20 Chris |