ChrisR has asked for the wisdom of the Perl Monks concerning the following question:
I have tried all sorts of combinations using the -default and -ok options like only setting one or the other or setting them to different values and have gotten nowhere. Is this even possible? I thought perhaps I needed to refresh the window, but I can't seem to find a function to do that other than those dealing with redraws. I tried to Hide() the window before making the change and then Show() the window after the change which makes the change of -default show up but nothing more. Any help would be greatly appreciated.use strict; use Win32::GUI; my $mainform = Win32::GUI::Window->new(-name=>'main',-text=>'test',-wi +dth=>200,-height=>200,-dialogui=>1); my $button1 = $mainform->AddButton(-name=>'button1',-top=>10,-left=>10 +,-text=>"button1",-ok=>1); my $button2 = $mainform->AddButton(-name=>'button2',-top=>40,-left=>10 +,-text=>"button2",-ok=>0); $mainform->Show(); Win32::GUI::Dialog(); exit; sub button1_Click { $mainform->MessageBox("You clicked button1. Changing the default +to button2.","button1"); $button1->Change(-ok=>0); $button2->Change(-ok=>1); } sub button2_Click { Win32::GUI->MessageBox("You clicked button2. Changing the default + to button1.","button2"); $button2->Change(-ok=>0); $button1->Change(-ok=>1); } sub main_Termintate { $mainform->Hide(); return -1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to change the default (ok) button in Win32::GUI
by ikegami (Patriarch) on Apr 20, 2005 at 21:53 UTC | |
by ChrisR (Hermit) on Apr 21, 2005 at 01:37 UTC | |
by ikegami (Patriarch) on Apr 21, 2005 at 01:49 UTC | |
by ChrisR (Hermit) on Apr 21, 2005 at 02:13 UTC | |
|
Re: How to change the default (ok) button in Win32::GUI
by jplindstrom (Monsignor) on Apr 21, 2005 at 11:19 UTC | |
by ChrisR (Hermit) on Apr 21, 2005 at 13:45 UTC |