Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Ascertaining attributes of a Tk object

by beretboy (Chaplain)
on Jul 01, 2005 at 15:37 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found