Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Perl-tk Get Coords from packed widget

by kean (Acolyte)
on Dec 17, 2012 at 14:28 UTC ( #1009176=perlquestion: print w/ replies, xml ) Need Help??
kean has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to get the actually x,y,width,height attributes from a widget that i put on a mainwindow with pack?

Comment on Perl-tk Get Coords from packed widget
Replies are listed 'Best First'.
Re: Perl-tk Get Coords from packed widget
by Tux (Monsignor) on Dec 17, 2012 at 15:11 UTC

    Once the widget is actually shown ($mw->update), you can ask for any widget's location and size with $widget->geometry, which will return something like "243x25+10+233".


    Enjoy, Have FUN! H.Merijn
Re: Perl-tk Get Coords from packed widget
by Anonymous Monk on Dec 17, 2012 at 14:31 UTC
    Sure, most probably :) add use Tk::WidgetDump; $mainWindow->WidgetDump; MainLoop; to your program and see if it has the details, see Tk::options

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2015-07-30 02:11 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 (269 votes), past polls