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

You can't easily affect the geometry of the DialogBox directly since it isn't visible until you Show() it... and doesn't return control until the Show() is done. You CAN pass parameters to the Show() method to affect how it is displayed however. It uses Tk::Popup internally to display. Check the documentation of Popup for details.

use warnings; use strict; use Tk; use Tk::DialogBox; my $mw = MainWindow->new; my $db = $mw->DialogBox( -title => 'Status', -buttons => ['Ok', 'Cance +l'] ); print $db->Show( -popover => $mw, -overanchor => 'c', -popanchor => ' +c' ); MainLoop;

Replies are listed 'Best First'.
Re^2: Tk - Place DialogBox in middle of top window
by Anonymous Monk on Aug 07, 2013 at 13:55 UTC
    This is the perfect hint. Thanks.