[opendemo-cvs] CVS: opendemo/tools/odcut OdGui.pm,NONE,1.1
Status: Beta
Brought to you by:
girlich
From: Uwe G. <gi...@us...> - 2005-02-07 21:27:32
|
Update of /cvsroot/opendemo/opendemo/tools/odcut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14228 Added Files: OdGui.pm Log Message: new GUI for odcut.pl. Will replace odcugui.pm --- NEW FILE: OdGui.pm --- #!/usr/bin/perl -w # $Id: OdGui.pm,v 1.1 2005/02/07 21:04:00 girlich Exp $ package odframe; use strict; use OdGuiGlade; use base qw(OdGuiFrame); use Wx::Event qw(EVT_BUTTON EVT_CLOSE EVT_MENU); sub new { my $classname = shift; my $self = $classname->SUPER::new(@_); $self->_init(@_); return $self; } sub _init($@) { my $self = shift; my $result = 0; # Connect objects. EVT_MENU($self,5,\&OnExit); EVT_MENU($self,21,\&OnAboutStart); EVT_CLOSE($self,\&OnClose); # Give a positive result. $result = 1; out: $result; } sub OnExit($) { my $self = shift; # print STDERR $self . "\n"; my $class = ref($self); # printf STDERR "odframe OnExit %s\n", $class; $self->Close(1); } sub OnAboutStart($) { my $self = shift; my $about = OdGuiAboutDialog->new($self); $about->ShowModal(); $about->Destroy(); } sub OnClose { my( $self, $event ) = @_; # printf STDERR "odframe OnClose\n"; $self->Destroy(); } 1; # Own application class. package OdGui; use strict; use base qw(Wx::App); sub OnInit { my( $self ) = shift; Wx::InitAllImageHandlers(); my $frame = odframe->new(); $self->SetTopWindow($frame); $frame->Show(1); return 1; } 1; # Main class. package main; unless(caller){ # Create the modified application object. my $app = OdGui->new(); # Main loop. exit $app->MainLoop(); } 1; |