Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Tk multiple monitor problem

by Khen1950fx (Canon)
on Mar 10, 2012 at 03:28 UTC ( [id://958829]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found