ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-mac
tcl-mac
Re: [MACTCL] Catching minimization of a window?
by Jim Ingham other posts by this author
Mar 28 2003 3:19AM messages near this date
Re: [MACTCL] Catching minimization of a window? | [MACTCL] Catching minimization of a window?
Daniel,

In this case, we should send Map and UnMap events.  After all, we do 
send Map & Unmap events when you explicitly call "wm iconify <WIN> ", 
which also sends the window to the Dock...  The John could do:

bind Toplevel <Unmap>  {whatever he wants to do}

So this is really a bug.

More generally, I agree that some Tcl based way to get at other Carbon 
events would be cool.  This would be easy to do, since you can register 
handlers with no events, then just call AddEventTypesToHandler as 
scripts were registered.

However, I bet there are a lot of the events listed in CarbonEvents.h 
that we won't get at all, since we don't register the standard Window 
Handler, and other standard handlers.  Many of the Carbon Events were 
synthesized by the standard handlers, last time I looked.

Jim

On Thursday, March 27, 2003, at 05:36  PM, Daniel A. Steffen wrote:

>  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
> 
--
Jim Ingham                                   jingham@[...].com
Developer Tools
Apple Computer



-------------------------------------------------------
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved