>> 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