1 #############################################################################
3 ## Purpose: Wx::App class
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: App.pm 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright: (c) 2000-2003, 2006 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
19 # this allows multiple ->new calls and it is an horrible kludge to allow
20 # Wx::Perl::SplashFast to work "better"; see also App.xs:Start
24 my $class = ref( $_[0] ) || $_[0];
25 if( ref( $Wx::wxTheApp ) ) {
26 bless $Wx::wxTheApp, $class;
27 $this = $Wx::wxTheApp;
29 $this = $_[0]->SUPER::new();
31 $Wx::wxTheApp = $this;
34 $this->SetAppName( $_[0] ); # reasonable default for Wx::ConfigBase::Get
36 my $ret = Wx::_App::Start( $this, $_[1] || $this->can( 'OnInit' ) );
37 Wx::_croak( 'OnInit must return a true return value' ) unless $ret;
44 package Wx::SimpleApp;
46 @Wx::SimpleApp::ISA = qw(Wx::App);