[perl-win32-gui-users] global destruction

2006-02-25 Thread Octavian Rasnita
Hi,

I have tried to set an event handler -onLostFocus, but if the control loses
the focus when the application closes (alt+F4), it gives the following
error:

Can't call method Text on an undefined value at E:\lucru\agenda\agenda.pl
line 68 during global destruction.

How can I detect if the control loses the focus because I have pressed the
tab key, or that if the whole application was closed?

Thank you.

Teddy




[perl-win32-gui-users] dynamic menus

2006-02-25 Thread Octavian Rasnita
Hi,

I want to create a part of a menu based on some settings from a
configuration file, so I want it to be created on runtime.
I want to have a menu item something like:

...
 Languages = Languages,
 English = {-name = english, -checked = 1, -onClick =
\change_interface('en')},
 French = {-name = French, -onClick = \change_interface('fr')},
...

How can I insert this piece of code in the menus?
I don't know how many languages are defined in the configuration file, so I
can't write this code staticly in the source, so I should define somehow
only the Languages menu item, then insert its submenus at runtime.

Also, how can I check/uncheck the menus while the program runs?

Thank you.



Teddy




[perl-win32-gui-users] Change()

2006-02-25 Thread Octavian Rasnita
Hi,

Does anyone have an example of using the Change() method (or another way)
for modifying the text that appears in the menus?
I want to let the user change the language of the interface without needing
to restart the application, so I need rewriting the menus.

Perhaps it is possible to create more different sets of menus, one for each
language, than to change the -menu parameter of $Window to use another menu,
but I would like to know if it is possible to create a single menu, than to
modify it to use another language.

Thanks.

Teddy