|
From: Daniel <dan...@ya...> - 2007-02-06 08:40:04
|
Hi Daniell,=0A=0Athanks for your answer. I think I know what you mean but i=
n fact I don't know how to do this. I made a sample script. It's like my ap=
plication but very small. So if you have time could you please be so kind a=
nd make it working? I think (or hope) it's easy for you.=0A=0A---- begin co=
de ----=0A=0A#!/usr/bin/perl -w=0A#=0A=0Ause strict;=0Ause Wx;=0A=0Apackage=
MyFrame;=0A=0A=0Ause base qw(Wx::Frame);=0A=0Ause Wx qw (wxDefaultPosition=
wxDefaultSize wxNO_FULL_REPAINT_ON_RESIZE wxCLIP_CHILDREN);=0A=0A=0Ause Wx=
::Event qw(EVT_BUTTON);=0A=0Amy $self;=0A=0A=0Asub new {=0A my $ref =3D =
shift;=0A=0A $self =3D $ref->SUPER::new( undef,=0A =
-1, =0A 'Exit-Test',=0A =
[50,50],=0A [300, 200]=
=0A );=0A=0A $self->SetIcon( Wx::GetWxPerlIco=
n() );=0A =0A my $notebook =3D Wx::Notebook->=
new( $self, =0A -1, =0A =
wxDefaultPosition, =0A wxDe=
faultSize,=0A wxNO_FULL_REPAINT_ON_RESIZE|=
wxCLIP_CHILDREN=0A );=0A=0A my $panel_u=
pdate =3D Wx::Panel->new( $notebook,=0A -1,=
=0A );=0A=0A $notebook->AddPage( $panel_u=
pdate, "Exit", 0 );=0A=0A=0A $panel_update->{button}{"install"} =3D Wx::=
Button->new( $panel_update,=0A -1,=0A =
'kill me',=0A =
[75, 20],=0A [150, -1],=0A =
);=0A =0A EVT_BUTTON($panel_update, $panel=
_update->{button}{"Exit"}, sub { =0A=0A #HERE THE APPLICATION SHOULD E=
XIT=0A #$self->Destroy();=0A #$frame->Destroy(); doesn't know $fr=
ame here=0A #exit(); #doesn't work=0A });=0A=0A my $status =3D =
Wx::StatusBar->new( $self, -1 );=0A $status -> SetFieldsCount( 1 );=0A =
$status -> SetStatusText( "Program running!" );=0A $self->SetStatusBar=
($status); =0A=0A return $self;=0A}=0A=0Apackage MyWindow;=0Ause base qw=
(Wx::App);=0A=0Asub OnInit {=0A my $frame =3D MyFrame->new;=0A $frame->Sh=
ow( 1 );=0A}=0A=0Apackage main;=0Amy $wxobj =3D MyWindow->new();=0A$wxobj->=
MainLoop;=0A=0A---- end code ----=0A=0A=0A=0AThanks! =0ADaniel=0A=0A=0A=0A=
=0A----- Urspr=FCngliche Mail ----=0AVon: Daniell Freed <win...@gm...=
m>=0AAn: Daniel <dan...@ya...>=0ACC: wxp...@li...=
.net=0AGesendet: Montag, den 5. Februar 2007, 23:48:26 Uhr=0ABetreff: Re: [=
wxperl-users] How to quit an Wx application?=0A=0AYou need to destroy any w=
indows you have. Closing them doesn't actually destroy them from memory.=
=0A=0AOnce you are done with the window do: $frame->Destroy();=0A=0A=0AThe=
n you can exit(); =0A=0A=0AThanks,=0ADan Freed=0A=0A=0A=0A=0A=0AOn Feb 5, =
2007, at 4:23 PM, Daniel wrote:=0A=0AHi all,=0A=0A=0AI know, it sounds stup=
id but I don't know how to quit my application from inside.=0A=0A=0AI used =
the following code:=0A=0A=0Apackage MyWindow; =0A=
use base qw(Wx::App); =0A=0A=0Asub OnInit {=0A my $f=
rame =3D MyFrame->new;=0A $frame->Show( 1 );=0A}=0A=0A=0Apackage main;=0Am=
y $wxobj =3D MyWindow->new(); =0A$wxobj->MainLoop;=0A=0A=0AIn pack=
age MyWindow there is in function new defined:=0A=0A=0A $self =3D $ref->=
SUPER::new( undef, # parent window=0A =
-1, # Window id=0A "$title", # T=
itel=0A [50,50], # Position x/y=0A =
[950, 600] # Size x/y=0A =
);=0A=0A=0ASo if I just do an exit() nothing happens but showing t=
he waiting mouse pointer. Same if I use=0A$self->Close(1);=0A=0A=0ACan some=
one help me please?=0A=0A=0A=0A=0AThanks=0ADaniel=0A=0A=0A=0A=0A=0A=0A=0A=
=0A=09=09=0A=0A___________________________________________________________ =
=0ATelefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de=
=0A=0A=0A------------------------------------------------------------------=
-------=0AUsing Tomcat but need to do more? Need to support web services, s=
ecurity?=0AGet stuff done quickly with pre-integrated technology to make yo=
ur job easier.=0ADownload IBM WebSphere Application Server v.1.0.1 based on=
Apache Geronimo=0Ahttp://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&b=
id=3D263057&dat=3D121642=0A_______________________________________________=
=0Awxperl-users mailing lis...@li...=0Ahttps:/=
/lists.sourceforge.net/lists/listinfo/wxperl-users=0A =0A=0A Daniell Freed=
=0Aw...@gm...=0ABereshit bara Elohim et hashamayim ve'et ha'arets.=
..=0A=0A =0A=0A=0A=0A=0A=0A=0A=0A=0A=09=09=0A______________________________=
_____________________________ =0ATelefonate ohne weitere Kosten vom PC zum =
PC: http://messenger.yahoo.de |