From: Zeke L. <ove...@ks...> - 2002-01-28 04:55:48
|
Could somebody point me in the right direction of making a dialog where if they click ok it goes ahead and closes the program but if they click cancel it goes back. I'm new to wxPerl I've tried copying some of the source from the dialogs sample but it doesn't work, this is what I got: sub OnQuit { my( $this, $event ) = @_; my $dialog = Wx::MessageBox( 'Exiting Worms GUI!', 'Message', wxOK|wxCANCEL, $this); if( $dialog->ShowModal == wxID_CANCEL ) { $dialog->Destroy; } else { $this->Close( 1 ); } } When I click either Ok or Cancel, I get this error: Can't call method "ShowModal" without a package or object reference at test3.pl line 72. and then perl crashes. Any help would be appreciated. |