inetbot web crawler
Main  |  Get access to the repository  |  API  |  The robot  |  Publications  |  Usenet Groups  |  Plainweb  | 
 inetbot - Groups (beta)

Current group: codewarrior.mac

Re: ActivateControl question

Re: ActivateControl question  
David Phillip Oster
 Re: ActivateControl question  
Steven Daedelus
From:David Phillip Oster
Subject:Re: ActivateControl question
Date:Sun, 05 Dec 2004 20:17:29 GMT
In article
,
David Phillip Oster wrote:

> In article ,
> Steven Daedelus wrote:
>
> > In article ,
> > Steven Daedelus wrote:
> >
> > > Hi,
> > >
> > > I have a Carbon project I have to complete in a few weeks, and I'm
> > > making what I consider to be a valiant effort at getting up to speed,
> > > but I keep hitting roadblocks. The latest:
> > >
> > > I have a button which starts out disabled. I set it this way in
> > > Interface Builder. When a certain series of actions are performed, I
> > > want to...
> > >
> > > ActivateControl(theButton);
> > >
> > > However, it doesn't work. Doesn't cause an error or anything -- it just
> > > doesn't work. What I discovered, however, is that if I set it to enabled
> > > in Interface Builder, then disable it in the course of using the
> > > application, I can then properly enable and disable it from there on out.
> > >
> > > Can anyone shed any light on this?
> > Answered my own question. Setting the control to disabled in Interface
> > Builder actually sets the Hilite to 255. So ActivateControl doesn't have
> > any effect.
> >
>
> But all that means is you've confused activate and deactivate events,
> which is what ActivateControl() is for, with enabling and disabling the
> control, which is what HiliteControl() is for.

Looks like _I_ was the one who was confused, and owe you an apology.
There's been a recent discussion of this point on Apple's Carbon
Developers mailing list, and Laurence Harris writes:

> FYI, the Control Manager PDF states:
>
> "If the Appearance Manager is available, you should call the functions
> ActivateControl (page 54) and DeactivateControl (page 54) instead of
> HiliteControl to activate or deactivate a control. This is important if the
> control is in an embedding hierarchy, since calling these functions will
> ensure that any latent embedded controls will be activated and deactivated
> correctly."

Thanks for pointing out a potential problem.

David Phillip Oster
From:Steven Daedelus
Subject:Re: ActivateControl question
Date:Mon, 06 Dec 2004 21:19:26 GMT
In article
,
David Phillip Oster wrote:

> In article
> ,
> David Phillip Oster wrote:
>
> > In article ,
> > Steven Daedelus wrote:
> >
> > > In article ,
> > > Steven Daedelus wrote:
> > >
> > > > Hi,
> > > >
> > > > I have a Carbon project I have to complete in a few weeks, and I'm
> > > > making what I consider to be a valiant effort at getting up to speed,
> > > > but I keep hitting roadblocks. The latest:
> > > >
> > > > I have a button which starts out disabled. I set it this way in
> > > > Interface Builder. When a certain series of actions are performed, I
> > > > want to...
> > > >
> > > > ActivateControl(theButton);
> > > >
> > > > However, it doesn't work. Doesn't cause an error or anything -- it just
> > > > doesn't work. What I discovered, however, is that if I set it to
> > > > enabled
> > > > in Interface Builder, then disable it in the course of using the
> > > > application, I can then properly enable and disable it from there on
> > > > out.
> > > >
> > > > Can anyone shed any light on this?
> > > Answered my own question. Setting the control to disabled in Interface
> > > Builder actually sets the Hilite to 255. So ActivateControl doesn't have
> > > any effect.
> > >
> >
> > But all that means is you've confused activate and deactivate events,
> > which is what ActivateControl() is for, with enabling and disabling the
> > control, which is what HiliteControl() is for.
>
> Looks like _I_ was the one who was confused, and owe you an apology.
> There's been a recent discussion of this point on Apple's Carbon
> Developers mailing list, and Laurence Harris writes:
>
> > FYI, the Control Manager PDF states:
> >
> > "If the Appearance Manager is available, you should call the functions
> > ActivateControl (page 54) and DeactivateControl (page 54) instead of
> > HiliteControl to activate or deactivate a control. This is important if the
> > control is in an embedding hierarchy, since calling these functions will
> > ensure that any latent embedded controls will be activated and deactivated
> > correctly."
>
> Thanks for pointing out a potential problem.

Fair enough -- this is all largely still Greek to me. ;) But if I read
this correctly it means that IB gets it wrong, yes? When you check the
disable box in IB, it sets the Hilite to 255, meaning you have to
properly set the Hilite before you can do anything meaningful with
ActivateControl and DeactivateControl. I guess a workaround would be to
disable stuff programmatically only, but that's kind of a drag.

Am I right? Is IB getting it wrong or am I just misunderstanding?
   

Copyright © 2006 inetbot   -   All rights reserved