develooper Front page | perl.wxperl.users | Postings from February 2013

RE: Modality and new windows

Thread Previous | Thread Next
From:
steveco.1959
Date:
February 18, 2013 16:11
Subject:
RE: Modality and new windows
Message ID:
354C639259B849A1B6C7D6EE16DE3F48@SACWS001
>> The key event I use is EVT_TEXT. (Maybe I should use EVT_CHAR?
>> Anyone?)

>In the case of autocompletion, I'd say EVT_CHAR is the best choice. You
>want to deal interactively with user input, not with programmatic
>changes of the field contents.

Hi Johan,

Ok, I've just tried this.  EVT_CHAR seems only
to require 2 parameters, the control and the handler, whereas EVT_TEXT
takes 3, parent, control and handler.

If I want to set a separate control (control2), I'd have to do

sub handler {
	my ($control, $event) = @_;
	$control->GetParent()->{"control2"}->SetValue( Stuff );
}

Whereas EVT_TEXT would be:

sub handler {
	my ($parent, $event) = @_;
	$parent->{"control2"}->SetValue( Stuff );
}

I'm not sure why they are different.  Are there any other impacts apart 
from EVT_TEXT firing for programmatic input?  EVT_CHAR does only fire for
character events and not for up-arrow and stuff, I guess.

Regards

Steve


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About