Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Tk multiple monitor problem

by JohnRS (Scribe)
on Mar 09, 2012 at 23:17 UTC ( [id://958808]=note: print w/replies, xml ) Need Help??


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

I'm afraid that adding the parameters to "new" doesn't make any difference when I try it. The screen shows up on the left monitor, but the DialogBox shows up on the main monitor.

Replies are listed 'Best First'.
Re^3: Tk multiple monitor problem
by Khen1950fx (Canon) on Mar 10, 2012 at 03:28 UTC
    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

      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://958808]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-16 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found