Hi, the overall effect can also be achieved via accelerator keys... define Enter as an accelerator key.

On approximately 11/26/2003 4:07 PM, came the following characters from
the keyboard of Steve Pick:
Hi,

I've just submitted an addition for Win32::GUI v0.0.665 which adds the
keycode and extra info as arguments to the onKeyDown handler. This allows
you to do this, to create a single-line text entry field which detects a
press of the Enter key.

my $textfield = new Win32::GUI::Textfield ($win,
 -name => "textfield1",
 -left => 0,
 -top => 0,
 -width => 100,
 -height => 20
 -multiline => 1,
 -autohscroll => 1,
 -autovscroll => 0,
 -onKeyDown => \&keydown,
);

sub keydown {
 my ($additional_data,$keycode) = @_;
 if($keycode == 13) {
    print "Enter has been pressed.\n";
 }
}

Hopefully this will be included in the next CVS update, and will allow you
to get Enter presses without using that nasty "default button" method.

Steve

----- Original Message ----- From: "Johan Lindstrom" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Wednesday, November 26, 2003 2:04 PM
Subject: Re: [perl-win32-gui-users] TextField entry



At 01:58 2003-11-26, Ross Clunie wrote:

I would like to be able to use the ENTER key as an event trigger for a
textfeild. I have the _LostFocus event set and this works when the tab

key

is used but I would like ENTER key to emulate this function. Is it

poosible.

Fake it by adding a button that is -ok and/or -default (I think -ok is an
option proper). Turn off the -tabstop and put the button outside the

window

(e.g. at 100000, 100000).

The button's _Click event will be triggered when you press Enter in the
Textfield.


/J

-------- ------ ---- --- -- --  --  -    -     -      -         -
Johan Lindström    Sourcerer @ Boss Casinos     [EMAIL PROTECTED]

Latest bookmark: "Oracle9i Database Concepts -- Contents"


<http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/toc.htm

dmoz (1 of 7): /Computers/Internet/E-mail/Free/ 9



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users



--
Glenn -- http://nevcal.com/
===========================
Like almost everyone, I receive a lot of spam every day, much of it
offering to help me get out of debt or get rich quick.  It's ridiculous.
-- Bill Gates

And here is why it is ridiculous:
The division that includes Windows posted an operating profit of $2.26 billion on revenue of $2.81 billion. --from Reuters via http://biz.yahoo.com/rc/031113/tech_microsoft_msn_1.html

So that's profit of over 400% of investment... with a bit more investment in Windows technology, particularly in the area of reliability, the profit percentage might go down, but so might the bugs and security problems? Seems like it would be a reasonable tradeoff. WalMart earnings are 3.4% of investment.


Reply via email to