Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Ascertaining attributes of a Tk object

by beretboy (Chaplain)
on Jul 01, 2005 at 15:37 UTC ( #471756=perlquestion: print w/ replies, xml ) Need Help??
beretboy has asked for the wisdom of the Perl Monks concerning the following question:

If I have a function that is being passed a Tk widget object, and only the object, how can I figure out various attributes (height, width, which position its in on the main window grid) about it?


"Sanity is the playground of the unimaginative" -Unknown

Considered: beretboy: "Please Reap. Lo and behold I found the answer within minutes of posting."
Unconsidered: davido: Final vote: (keep/edit/delete) => 20/2/4. Keeps blocked reaping. Others will find node useful.

Comment on Ascertaining attributes of a Tk object
Re: Ascertaining attributes of a Tk object
by beretboy (Chaplain) on Jul 01, 2005 at 15:44 UTC
    This is suprisingly hard to find reading the Tk docs, but very clearly laid out in Chapter 13 of Mastering Perl/Tk:
    $widget->cget(-option)
    Will return the current setting of the option.


    "Sanity is the playground of the unimaginative" -Unknown
Re: Ascertaining attributes of a Tk object
by zentara (Archbishop) on Jul 02, 2005 at 12:18 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://471756]
Approved by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2015-07-06 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (80 votes), past polls