Thread

Posted on Sun Jul 31 18:16:01 2005 by xol
onCreate like calback
I need to make something like onCreate callback in my perl Tk script. In other words I want my subroutine to run when I create some widget. How can I do it? A simple binding to Create event is not working. Thank you in advance.
Alex.
Dimax U2C-11 USB to I2C/SPI/GPIO Adapter
Direct Responses: 814 | Write a response
Posted on Sun Jul 31 19:43:13 2005 by vkon in response to 813
Re: onCreate like calback
I can't manage syntax on this page, so please see my answer at http://www.vkonovalov.ru/cgi-bin/usemod-wiki.pl?Tcltk-Oncreate
Direct Responses: 815 | Write a response
Posted on Sun Jul 31 23:14:04 2005 by xol in response to 814
Re: onCreate like calback
Thanks. I'm using Tk module, not Tcl:Tk, do you think it will still work? Seams strange that such a comon and widely used feature was not implemented. Probably I'm doing something wrong? I need to initialize some resource ( let's say open a file ) and I want to notify user in case of error by message box and not by printing message. It means I have to run GUI main loop prior to poping up the message box. I though to put inititalization code in onCreate handler and be able to make some GUI communication with user if I have a problems.

Thanks.

#
# Dimax USB to I2C/SPI/GPIO Adapter
#
Direct Responses: 816 | 817 | Write a response
Posted on Mon Aug 1 09:36:00 2005 by vkonovalov in response to 815
Re: onCreate like calback
Tcl::Tk and Tk are different Perl modules, so you must ask elsewhere, but many questions have very same answer, as these have many in common: they provide same thing to user but have different way of embedding Tk into module. IMO Tcl::Tk is better to use due to more flexibility you get. As to your direct question, you can try asking your question Tcl people, at ActiveTcl@listserv.ActiveState.com or even better at their TCT ML
Write a response
Posted on Mon Aug 1 09:42:19 2005 by xol in response to 815
Re: onCreate like calback
Ok. Thanks a lot. It's working with Tk::MainWindow as well.

#
#Dimax USB to I2C/SPI/GPIO Adapter
#
Write a response