From: Manuel R. <m....@te...> - 2006-04-14 17:21:27
|
Hey, Currently I'm trying to get Wx::Wizard working and I'm having some = problems. First: I get an "EVT_WIZARD_FINISHED is not exported" error and = EVT_WIZARD_CANCEL clames that it has not enough paramters, but the doc = says EVT_WIZARD_CANCEL(id, func) Second:=20 I need to click twice on the [X] to get the EVT_CLOSE working and = succesfully running my OnClose sub... Why that? Attached the test script. It's mainly based on the demo code. I'm on WinXP running the latest Activeperl 5.8.7 (815)=20 Wxperl 0.26 Hope you can help me. Greetz & blessings=20 Manuel ######################################################## #!/usr/bin/perl -w --=20 use strict; package MyApp; # Package-Name ###################################################### Wx-Module use Wx; use Wx qw[:allclasses]; use Wx qw[:everything]; use base qw(Wx::App); sub OnInit { my( $this ) =3D @_; =20 my( $dialog ) =3D MyWizard->new( "Wizard", wxDefaultPosition, ); $this->SetTopWindow( $dialog ); =20 $dialog->Show( 1 ); =20 1; } # end of class MyApp package MyWizard; #use Wx::Wizard; use Wx::Event qw( EVT_WIZARD_PAGE_CHANGED=20 EVT_BUTTON=20 EVT_CLOSE=20 EVT_WIZARD_CANCEL=20 EVT_WIZARD_FINISHED ); sub new { # Panel erzeugen my $class =3D shift; Wx::InitAllImageHandlers(); =20 my $wizard =3D Wx::Wizard->new( undef, -1, "Wizard test" ); =20 # 1. Seite Excel Datei ausw=E4hlen my $page1 =3D Wx::WizardPageSimple->new( $wizard ); Wx::TextCtrl->new( $page1, -1, "First page" ); =20 # 2. Seite Feld zuordnung / Preisdatum / Herstellerk=FCrzel my $page2 =3D Wx::WizardPageSimple->new( $wizard ); Wx::TextCtrl->new( $page2, -1, "Second page" ); =20 Wx::WizardPageSimple::Chain( $page1, $page2 ); =20 $wizard->RunWizard( $page1 ); =20 EVT_WIZARD_CANCEL ($wizard, \&OnClose ); EVT_WIZARD_FINISHED ($wizard, \&OnClose); EVT_CLOSE ($wizard, \&OnClose ); return $wizard; } sub OnClose { my $this =3D shift; print "Foo"; $this->Destroy; } package main; unless(caller){ my $kasse1 =3D MyApp->new(); $kasse1->MainLoop(); } |