Re: How to find out path of widget in TK-like style ?
by Slaven Rezic other posts by this author
Jul 19 2007 5:11PM messages near this date
How to find out path of widget in TK-like style ?
|
Re: How to find out path of widget in TK-like style ?
SOURCE Joel HATSCH <ptk@[...].net> writes:
[...]
> OK, so here it goes : I did a lot of Tk programming in the past.
> There, when you want to access a widget, you address it using it's
> hierarchical name like .frame1.frame2.mybutton. In ptk however, you
> use variables to store the objects. If you know the parent's
> variable, you can browse through its children to find the given
> widget. However, there doesn't seem to be a function that maps the
> string ".frame1.frame2.mybutton" to the corresponding widget's
> variable.
There is: $mainwindow-> Widget($pathname).
For example:
$ perl -MTk -e '$mw=tkinit;warn $mw-> Frame->Frame->Label;warn $mw->Widget(".frame.frame.labe
l")'
Tk::Label=HASH(0x9024f8) at -e line 1.
Tk::Label=HASH(0x9024f8) at -e line 1.
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
tkruler - Perl/Tk program for measuring screen distances
http://ptktools.sourceforge.net/#tkruler
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
ptk@[...].edu
https://mailman.stanford.edu/mailman/listinfo/ptk
Thread:
Joel HATSCH
Slaven Rezic
Vadim
Joel HATSCH
|