Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Tk - Place DialogBox in middle of top window

by Sinistral (Monsignor)
on Jul 06, 2010 at 12:28 UTC ( [id://848207]=note: print w/replies, xml ) Need Help??


in reply to Tk - Place DialogBox in middle of top window

You need the -geometry option, which is described here:
http://www.wellho.net/forum/The-Tcl-programming-language/Tk-Geometry-strings.html

To be able to place a dialog on top of another window, you'll need to use the winfo command to get the information. In Perl, you'll want to do something like:
$mw->winfo("geometry")

See all possible winfo strings here: http://www.wellho.net/forum/The-Tcl-programming-language/Tk-Geometry-strings.html

Replies are listed 'Best First'.
Re^2: Tk - Place DialogBox in middle of top window
by Dirk80 (Pilgrim) on Jul 06, 2010 at 14:10 UTC

    Hello,

    Thank you for your answer. To get the geometry information via winfo is working fine. So it is no problem to compute the geometry information I need to place the dialogbox in the middle of the main window.

    My problem is how can I set the geometry information to the dialogbox?

    I tried the following code:

    my $db = $mw->DialogBox(-title => "Status", -buttons => ['Cancel'], -geometry => "300x300x+100+100");

    I got this error:

    Tk::Error: Can't set -geometry to `300x300x+100+100' for Tk::DialogBox +=HASH(0x1d85574): unknown option "-geometry" at c:/Perl/site/lib/Tk/C +onfigure.pm line 46. at c:/Perl/site/lib/Tk/Derived.pm line 294

    Thank you for your help.

    Greetings,

    Dirk

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://848207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found