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

tk minimize event

by blueberryCoffee (Scribe)
on Mar 21, 2005 at 07:24 UTC ( #441134=perlquestion: print w/replies, xml ) Need Help??

blueberryCoffee has asked for the wisdom of the Perl Monks concerning the following question:

I want to know when a user minimizes my tk app so I can put a small status indicator in the corner.

I have looked in tk::widgets, tk::wm, tk::bind, and tk::toplevel docs and found nothing about events like this (minimize, maximize). I also searched the perl directory for any mention of the word "minimize". Am I looking for the wrong word? How can I set callbacks for these events?


Replies are listed 'Best First'.
Re: tk minimize event
by PodMaster (Abbot) on Mar 21, 2005 at 08:12 UTC
      Thanks, found it on

      For anyone else who wishes to know. The tags to bind are 'Configure', 'Map', and 'Unmap'.

      The Configure event is fired any time you move or resize the window (this includes maximizing). The Map event happens when you un-minimize a window, and Unmap happens when you minimize the window.

      An example:
      use Tk; my $app = new MainWindow; $app->bind('<Configure>', sub{ print "configure"; }); $app->bind('<Unmap>', sub{ print "Unmap"; }); $app->bind('<Map>', sub{ print "Map"; }); MainLoop;

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://441134]
Approved by ysth
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2023-01-27 13:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found