Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Perl Tk: How Can I get the MainWindow Configuration?

by ungalnanban (Pilgrim)
on Feb 25, 2010 at 10:23 UTC ( #825268=perlquestion: print w/ replies, xml ) Need Help??
ungalnanban has asked for the wisdom of the Perl Monks concerning the following question:

Hi..
In Perl Tk how Can I get the MainWindow information as a hash or array?
Like PackInfo().

Comment on Perl Tk: How Can I get the MainWindow Configuration?
Re: Perl Tk: How Can I get the MainWindow Configuration?
by Khen1950fx (Canon) on Feb 25, 2010 at 11:38 UTC
    I'm not quite sure why you want to get the MainWindow info in a way similar to packInfo; however, I ran a simple search of perlmonks and found a way that might help you. Take a look at zentara's Re^3: Toplevel Window References in Perl Tk. As for getting the MainWindow configuration, look at the script here.

      I want to show the width and height of the MainWindow in status bar and change the Title of the Window Based on the arguments.
      Is there any function or any way to achieve this?

        Like this?:
        ... my $height = $mw->screenheight; my $width = $mw->screenwidth; my $geom = $mw->geometry; $mw->title("New Title ($geom)");
        Update:

        Changed code to show geometry of the window instead of the screen.

        Update2: Width and height (for any widget):
        my $height = $mw->height; my $width = $mw->width; $mw->title("New Title ($width x $height)");

        Other options are here: Tk::Widget

        I am confused about this. When you create a MainWindow, you can specify the minimum size for the x,y coordinates. So you know that. You should also know the title text that you want.

        change the Title of the Window Based on the arguments. Change based upon what arguments?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-09-16 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (33 votes), past polls