ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-tk
perl-tk
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved