RE: Re: [wxperl-users] Re: Re: EVT_QUERY_END_SESSION

you putted the EVT_CLOSE to the wrong place...

or do you have a reason why you need it to be there?
$app ist not the window, but you could use EVT_CLOSE on $frame too.

i changed your minimal sample that it works.
hope it helps

greeting
Marco

----

use Wx;

###########################

package MyApp;

use strict;
use vars qw(@ISA);
@ISA=qw(Wx::App);

sub OnInit
{
  my( $this ) = @_;

  my( $frame ) = MyFrame->new( "Minimal wxPerl app",
          Wx::Point->new( 50, 50 ),
          Wx::Size->new( 450, 350 )
                             );

  $this->SetTopWindow( $frame );
  $frame->Show( 1 );

  1;
}

###########################

package MyFrame;

use strict;
use vars qw(@ISA);
@ISA=qw(Wx::Frame);

use Wx::Event qw(EVT_CLOSE);

sub new
{
	my( $class ) = shift;
	my( $this ) = $class->SUPER::new( undef, -1, $_[0], $_[1], $_[2] );

	EVT_CLOSE( $this , \&onClose);

	$this;
}

sub onClose
{
	my ($this, $event) = @_;

	print "try to close...\n";
	
	$event->Skip; # allow to close
}

###########################

package main;

my ($app) = MyApp->new();
$app->MainLoop();

0
mtrudel
8/29/2002 7:40:02 PM
perl.wxperl.users 3070 articles. 0 followers. Follow

0 Replies
1247 Views

Similar Articles

[PageSpeed] 6

Reply:

Similar Artilces:

RE: [wxperl-users] Re to Marco: Re: EVT_QUERY_END_SESSION
> > you putted the EVT_CLOSE to the wrong place... > > > > or do you have a reason why you need it to be there? > > $app ist not the window, but you could use EVT_CLOSE on $frame too. > > I know that EVT_CLOSE is for frame. What I want is a event for the app,= when > the app goes to be closed! Maybe the only way is to check the close in the > topwindow! ah, ok. that's easy if you don't want to veto the exit: ### code start my($app) =3D MyApp->new(); $app->MainLoop(); print "here's definitly the last point before t...

RE: RE: RE: RE: [wxperl-users] wxTreeCtrl, edit an treeItem
>>Found a fix ( I hope ); download the modified wx22_9.dll from >>http://wwwstud.dsi.unive.it/~mbarbon/wx/wx22_9.dll.gz >>uncompress it and put it in $PERL/site/lib/auto/Wx >>( make a backup of the original one, of course ). >>This fixes your problem with tree control, but may introduce >>new ones ( it is a fix backported from wxWIndows 2.3 ). >> >>Regards >>Mattia > >hey thanks man! >i had no time to work on my application but i checked the wxwindows >mailinglist archive. you asked for a code change as workaround......

Re: [wxperl-users] Re: wxperl
yes !! its really time to help more mattia. things i could offer are beside bug reports is to help to buil a better brwosable doku, this is one of my long time wish so are so. herbert "Graciliano M. P." <gmpowers@terra.com.br> schrieb am 11.12.04 03:29:27: > > > hey all, > > > > I just tried downloading the cvs snapshot, Wx-0.20, Wx-0.19, and Wx-0.18 > > and trying to install them on solaris (without luck). I tried both > wxAll-2.4.2 > > and wxWidgets-2.5.3. > > > > Furthermore, I went to the wikis for more in...

RE: RE: RE: [wxperl-users] wxTreeCtrl, edit an treeItem
>Found a fix ( I hope ); download the modified wx22_9.dll from >http://wwwstud.dsi.unive.it/~mbarbon/wx/wx22_9.dll.gz >uncompress it and put it in $PERL/site/lib/auto/Wx >( make a backup of the original one, of course ). >This fixes your problem with tree control, but may introduce >new ones ( it is a fix backported from wxWIndows 2.3 ). > >Regards >Mattia hey thanks man! i had no time to work on my application but i checked the wxwindows mailinglist archive. you asked for a code change as workaround... this week, while doing something totally differe...

[wxperl-users] Re: Re: Re: Compiling in Win32 with MingW
Thanks for help! I disable it, I just want to know if every thing ill work fine. Now I'm writing a guide to compile wxperl with mingw, step by step, from downloading mingw, instaling wxwindows, geting a version of perl, etc... Graciliano M. P. > I got the new file, with changes from CVS (build/Win32_MinGW.pm). > > > > Now the compilation don't look for the Wx.a :) > Yes, I know, I did that on purpose... > > > All the extension compile fine, unless the XRC! It got erros with > > libwxxrc.a, or something like that! > > > >...

[wxperl-users] Re to Marco: Re: EVT_QUERY_END_SESSION
> you putted the EVT_CLOSE to the wrong place... > > or do you have a reason why you need it to be there? > $app ist not the window, but you could use EVT_CLOSE on $frame too. I know that EVT_CLOSE is for frame. What I want is a event for the app, when the app goes to be closed! Maybe the only way is to check the close in the topwindow! > > i changed your minimal sample that it works. > hope it helps Thanks for the help. Graciliano M. P. ...

RE: RE: Re: [wxperl-users] Wx::DropTarget -> OnDragOver
yes, i'm using win98 and the wxPerl beta 4. looks like one of them has a bug. right now i've no way to test it on another platform (win2000 or linux) if win98 has a bug, i've to programm this feature myself, so, how can i get if the CONTROL key is pressed? then i can set the $desired myself. greeting Marco >> sorry for the delay, had to do other stuff. >> hope you still remember. >Yes > >> i worked so long on my explanation, but looks like it was still not >> clear enough. well, here with a code example: >Well, it was clear...

RE: [wxperl-users] Re: wxValidator available via wxPerl
Mattia, Thanks, as usual, for the to-the-point and quick support! If/when I manage to produce a useful validator, I would be more than happy to submit it. Currently I'm still getting my head round how everything fits together! James > -----Original Message----- > From: Mattia Barbon [mailto:mbarbon@dsi.unive.it] > Sent: 13 December 2001 11:04 > To: wxperl-users@lists.sourceforge.net > Subject: [wxperl-users] Re: wxValidator available via wxPerl >=20 >=20 > > Dear Mattia, > > I would like to use validators in my Perl application, but=20 ...

RE: [wxperl-users] Re: wxValidator available via wxPerl
Dear Mattia (or others, if they can help), I've been delving into how to use wxValidators, and I think I understand the concept (and I like it!). However, I'm having real trouble deriving my own validator (called, unimaginitively, myValidator) from Wx::PlValidator. >From the wxWindows documentation, all validators must implement a Clone method. I have tried implementing a Clone method, which I can see getting called, but myValidator's Validate, TransferFromWindow, and TransferToWindow never seem to get called. Here is my code (with the methods apart from Clone do...

Re:[wxperl-users] Re: wxPerl 0.23 release
> Mattia Barbon <mattia.barbon@libero.it> writes: > > > On Tue, 28 J= un 2005 22:44:29 +0200 Johan Vromans <jvromans@squirrel.nl> wrote:=0D = > > Under Windows the change in the default font is to > > be expected= .. > > I'm using Fedora Core 2... :-) I suppose I could not be m= ore wrong... Anyway: the font change looks like a GTK+ 1.2 vs 2.x ch= ange. For the button width you should try the wxBU_EXACTFIT style fo= r the buttons that need to be smaller than standard buttons. HTH=0D = Mattia =0A=0A=0A...

RE: [wxperl-users] Re: wxValidator available via wxPerl #4
Mattia, > > Yes, I think a Perl-implemented GenericValidator can just take the > > address of the variable to/from which to deposit/get data, and can > > handle it appropriately internally by checking the reference type. > the trouble is that in perl you can only have scalar references, > so you need a flag to tell the class you want a number/string/bool > transferred Good point. I think I'll use the 'flag' approach. This has approach has been used elsewhere (in Win32::API, I think), so I'll try to be consistent with other modules. =20 ...

RE: [wxperl-users] Re: wxValidator available via wxPerl #3
> wxTextValidator is OK for Perl, while wxGenericValidator does > 1 - use overloading > wxGV construtor takes one of a int/bool/string/integer array > (C++) pointer ( think Perl references ), but in Perl > int/string/bool map to scalar. Yes, I think a Perl-implemented GenericValidator can just take the address of the variable to/from which to deposit/get data, and can handle it appropriately internally by checking the reference type. > 2 - there is no NumericValidator ( or whatever you want to call it ) > one that does a text->number conversio...

RE: [wxperl-users] Re: wxValidator available via wxPerl #2
Dear Mattia, Thanks - this works a treat! I was so close... Anyway, now I'm up and running. I had noticed the 'Attempt to free unreferenced...' error - will await a fix. Now that I've got things working, what do you suggest/would you like? I feel that validators are the way to go when it comes to transferring data to/from controls (rather than explicit GetValue/SetValue calls all over the place) - I have had to implement a similar concept (though not as elegant) in a very large Perl/Tk application which we have developed. I see that you think we should create...

Re: Re: [wxperl-users] EVT_STC_*
k m y fault beeing unclear, by establishing i mean to make an event like this: EVT_MIDDLE_UP ($h->{tabs}, \&pce::file::close_current); but when i try similar things with EVT_STC_SAVEPOINTREACHED ($h->{editpanel}, \&{sub {spit some error message;} }) i have no success (yes event contant are importet without flaw) i also tried some variation and checked some other sources but i still have no clue whats wrong. thanks herbert On Sat, 11 Jun 2005 11:53:15 +0200 herbert breunung <deirdre_skye@web.de> wrote: Hello, > k m y fa...

Web resources about - RE: Re: [wxperl-users] Re: Re: EVT_QUERY_END_SESSION - perl.wxperl.users

Resources last updated: 11/24/2015 9:20:52 AM