Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Tk main window protocole maximize

by zentara (Archbishop)
on Apr 25, 2018 at 12:00 UTC ( [id://1213524]=note: print w/replies, xml ) Need Help??


in reply to Tk main window protocole maximize

As a practical workaround solution, you can use tybalt89's solution, and check the current width and height vs. the maximum screen size in the configure subroutine callback. Another less desirable hack is to use overrideredirect, to remove the Window Manager controls, and then make your own maximize button.
#!/usr/bin/perl use warnings; use strict; use Tk; my $top = MainWindow->new; $top->geometry('200x200+200+200'); $top->overrideredirect(1); $top->Button( -text => 'Maximize', -command => sub { $top->geometry($top->screenwidth . 'x' . $top->s +creenheight . '+0+0'); print "Maximized\n"; })->pack; $top->Button( -text => 'Exit', -command => sub { $top->destroy } )->pack; MainLoop;

I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

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

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

    No recent polls found