Hi,

I thought that if I define an EVT_CHAR event handler for a form is enough, and 
that event will appear each time a key is pressed, no matter which control on 
that form has the focus:

EVT_CHAR($self, \&OnChar);

sub OnChar {
    my ( $self, $event ) = @_;
    die "OnChar";
}

But if there are some controls on the form and one of them has the focus in a 
certain moment, the function OnChar is not called.
If I comment out all the controls definitions and the form remains empty, that 
function is called.

I've seen that if I define an event handler for each controls on the form, the 
event handler works when a certain control has the focus:

EVT_CHAR($self->{TextField}, \&OnChar);

But... is this the way it should be? Isn't there something wrong?
I found a little strange that the form's event handler EVT_CHAR is not working 
if there are controls on the form and that I need to define this event handler 
for all the form elements.

Thanks.

Octavian

Reply via email to