realbasic-nug
[Top] [All Lists]

Re: detecting window activation in a canvas?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: detecting window activation in a canvas?
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Sat, 30 Apr 2005 12:58:20 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <p06110400be98b945fbcc at 132 dot 236 dot 112 dot 9> <3396e7e205043008564a8a9a4f at mail dot gmail dot com>

On Apr 30, 2005, at 11:56 AM, Will Leshner wrote:

On 4/29/05, Bob Wyttenbach <rw12 at cornell dot edu> wrote:

Ideally, I'd like all controls to receive the activate/deactivate
event when the window does, or for the window class itself to have a
boolean property "Active" that could be checked by controls.

How about if controls had an Active property that was true when the
control was active and false when it wasn't? If that sounds like it
might work, then you are in luck, because all RectControls and their
subclasses have such a property.


But your luck runs out when you attempt to use the RectControl.Active property in the Window.Activate or Deactivate events, because the event handlers are called before the value of Active is changed. To work around this in Carbon apps, you can use the Window Manager function IsWindowActive.

I just added a subsection about this to my book; see Windows: Miscellany.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>