Re: [MACTCL] Catching minimization of a window?
by Daniel A. Steffen other posts by this author
Mar 28 2003 1:36AM messages near this date
Re: [MACTCL] Python tkinter
|
Re: [MACTCL] Catching minimization of a window?
John,
On Friday, Mar 28, 2003, at 11:59 Australia/Sydney, John P Speno wrote:
> Speaking of such, is there a way in Tcl/Tk to intercept when a window
> is
> minimized?
>
> Would I have to check the location of a button press and figure out if
> it
> was in the yellow '-' button? Or is some other even generated?
not in Tk at present AFAIK, but there's certainly carbon events
generated for minimization, c.f. CarbonEvents.h:
/*
* Notification that the window is about to collapse. Available in
* Mac OS X 10.1 and later.
*/
kEventWindowCollapsing = 86,
/*
* Notification that the window has successfully collapsed.
*/
kEventWindowCollapsed = 67,
/*
* Notification that the window is about to expand. Available in Mac
* OS X 10.1 and later.
*/
kEventWindowExpanding = 87,
/*
* Notification that the window has successfully expanded.
*/
kEventWindowExpanded = 70,
It should be possible to implement Tk access to these via a small C
extension, e.g. it wouldn't be hard to add handlers that pass these
carbon events along as Tk events (probably best to use virtual events).
The -ing events can prevent collapse/expand, I don't know if that would
be useful/usable in Tk.
There are all sorts of other events in CarbonEvents.h that would be
interesting to have access to from Tk, maybe we should think about some
type of generic script level access to InstallEventHandler(), to enable
us to create e.g. additional virtual events that can be bound to?
I think this could also be implemented in an extension in a first
instance, and maybe moved into the core if it turns out to be useful.
Cheers,
Daniel
--
** Daniel A. Steffen ** "And now for something completely
** Dept. of Mathematics ** different" Monty Python
** Macquarie University ** <mailto:steffen@[...].au>
** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/>
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Tcl-mac mailing list
Tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Daniel A. Steffen
Jim Ingham
|