in reply to Re^2: Tk multiple monitor problem
in thread Tk multiple monitor problem

Hmmm...Maybe Show needs to be handled differently. I tried this, but I used a different geometry.
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::widgets qw/DialogBox/; require Tk::LabEntry; my $uname = 'Anonymous'; my $pw = 'Anonymous'; my $mw = MainWindow->new( -screen => $ARGV[0] || $ENV{'DISPLAY'}, -bg => 'black', ); $mw->withdraw; my $box = $mw->title('Test'); $box = $mw->geometry('-1+1'); $box = $mw->DialogBox( -title => 'Login', -buttons => [ 'OK', 'Quit' ], -fg => 'red', -default_button => 'OK', ); $box->add( 'LabEntry', -textvariable => \$uname, -width => 20, -bg => 'black', -fg => 'green', -label => 'Username', -labelPack => [ -side => 'left' ] )->pack; $box->add( 'LabEntry', -textvariable => \$pw, -bg => 'black', -fg => 'green', -width => 20, -label => 'Password', -show => '*', -labelPack => [ -side => 'left' ] )->pack; $box->Show( -popover => $mw ); MainLoop;
Updated; Added $mw->withdraw

Replies are listed 'Best First'.
Re^4: Tk multiple monitor problem
by JohnRS (Scribe) on Mar 10, 2012 at 11:19 UTC

    I'm afraid that the geometry parameters that you are using, geometry('-1+1'), places $mw on the upper right of the main monitor. Thus the popup does appear correctly in the $mw. To see the problem I am fighting, change the geometry to ('+-300+1'). Now $mw appears on the left monitor, as it should, but the popup appears on the main monitor. In other words, geometry is working correctly but Show isn't.