Re: perltray/tk intercept windows minimize function
listmail <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the response. I found a similar response to yours addressed to me from someone on the ptk list while viewing the codecomments archives. Looks like I haven't been getting the ptk emails for who knows how long. Hopefully I can get that fixed soon. I liked Rob's solution by removing the buttons, this seemed cleaner and easier to support after implementing it. Nick Ing-Simmons wrote: > Listmail <[email protected]> writes: > >> I'm not sure what that last bit is all about :), but the user uses the >> application like a vast majority of other applications coded to run in >> the system tray by interacting with the system tray icon as opposed to a >> task bar button. Typically, double clicking the system tray icon redraws >> the application right where it left off or right clicking the system >> tray icon can provide the user with a menu with that contains that same >> "redraw" option as well a few others like "hide" and "exit" (as shown >> below). Most "system tray" applications that I know of create a >> "minimize to the system tray" effect instead of remaining a task bar >> button. >> > > Okay, I can see why you want to do what you suggest then. > And you DO want to minimize the application so you are not breaking > the user's mental model of what s/he is asking machine to do. Fine. > > But as you are minimizing ... widget is not going to be destroyed > but just hidden. > > First an aside: > [On X what happens is that when user clicks on minimize button window manager > withdraws the main window and that sends an event to the application. > Window manager may then display an icon on the desktop or in a tray. > Application can however withdraw the _icon_ (which is just another window). > So on X you don't override minimize but instead bind to the visibility > event(s) on the application window and the icon window > ] > > Meanwhile back in wonderful world of Windows there is no doubt a whole other > mechanism which presumably allows same effects. > > How Windows part of core-tk maps windows events to X-like ones is > sometimes a little strange but it does try. > (Tcl/Tk started on X and still retains an X-like view of the world.) > So it is possible that you can get what you want by > a bind : > > $toplevel->bind('<Unmap>',YourCallback); > > <Unmap> may not be the right event, but is what X would do. > > See if that gives you the hook to cache the minimize. Then I think > if you withdraw the window the task-bar icon will go too. > > If that doesn't work then you probably need a new "window class" registered > which is easy to do in a C/C++ application but I have never set anything up > to do it from perl. > > > > > > -++**==--++**==--++**==--++**==--++**==--++**==--++**== > This message was posted through the Stanford campus mailing list > server. If you wish to unsubscribe from this mailing list, send the > message body of "unsubscribe ptk" to [email protected] > > -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected]