Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Tk window location Win 7

by Anonymous Monk
on Mar 10, 2020 at 02:07 UTC ( [id://11114059]=note: print w/replies, xml ) Need Help??


in reply to Re: Tk window location Win 7
in thread Tk window location Win 7

Thank you for bothering to reply. The code below is just a bit of the definition of $G=$mw->DialogBox with most fields initially disabled. $G isn't displayed until requested by action in the main window.
if(not defined $G) { $G = $mw->DialogBox(title => "List", -buttons => ["Edit/Save", "Add Picture", "Exit"], -default_button=>"Exit", -cancel_button=>'Exit', -command=>\&handle_display_button); # lots of code here my $img2 = $mv->Photo('resized'); $G->Label(-image=>'resized', -height=>400, -width=>600)->place(-x=>20, -y=>190); $lft= $G->Button(-image=>'left', -command=>[\&change_picture, 'down'], -relief=>'flat')->place(-x=>0, -y=>350); $rr = $Gems->Button(-image=>'right', -command=>[\&change_picture, 'up'], -relief=>'flat')->place(-x=>620, -y=>350); $scale = $G->Scale(-from=>0, -to=>$#Search_List, -variable=>\$sb_idx, -command=>\&Change_Record, -orient=>'horizontal', -length=>540)->place(-x=>50, -y=>600); # $G->positionfrom('program'); $G->geometry('650x680+0+0'); # $G->geometry('+0+0'); $G->minsize(650,680); $G->maxsize(650,680); } $G->Show;
->geometry('650x680); gave it the size I wanted, but it started opening half off screen so I added '+pos+pos', but it didn't change anything, no matter what values I used. Every time it is shown it is always in the same place and I have to move it manually to see it in its entirety.

Replies are listed 'Best First'.
Re^3: Tk window location Win 7
by tybalt89 (Monsignor) on Mar 10, 2020 at 03:20 UTC
    #!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11114006 use warnings; use Tk; use Tk::DialogBox; my $mw = MainWindow->new; $mw->geometry( '300x300+600+300' ); my $G = $mw->DialogBox( -popover => undef, -popanchor => 'nw', -overanchor => 'nw'); $G->minsize(650,680); $G->maxsize(650,680); $mw->Button(-text => 'Open Dialog Box', -command => sub { $G->Show }, )->pack; MainLoop;
      Thank you, that did the trick

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found