Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the signature of a window



On 1/29/05 5:38 PM, Mike Lazear didst favor us with:

> 
> On Jan 28, 2005, at 7:42 PM, Laurence Harris wrote:
> 
>> On 1/28/05 9:01 PM, Mike Lazear didst favor us with:
>> 
>>> My event handler does a switch using the ID but ignoring the signature.
>>> 
>> This is a design flaw in your application.
>> 
> Makes sense.  I do a lot of looking at the sample code programs for examples
> of the "right" way to do things.  It is very possible but I sure don't
> remember seeing any of the sample programs testing against the signature.  If
> there is an Event Handler attached to each control then I guess you would not
> have to worry about it because you would only attach to your own controls.
> Makes sense with a window event handler to have to make the signature test.

I'm not sure why you even need to test this. Why do you have a
kEventMouseDown handler attached to your window? Most low-level events like
this are handled by the views/controls in the window or handlers attached to
the controls.

>>> 1. Is there a way to change the signature/ID of a window or is it always
>>> signature 'wind', ID 1?
>>> 
>> Sure, you can change it, but you'll be sorry. The system uses that and you'd
>> just be asking for trouble to change it. Apple reserves all all-lowercase
>> FourCharCodes and you shouldn't muck with any values the system sets in
>> things you don't own. You should not be ignoring the signature. That's a
>> design flaw in your application you should fix instead of trying to hack
>> around it like this.
>> 
> I wasn't really trying to "hack around it" as much as make sure that was the
> correct thing to test.

Sorry, but changing the content view's signature would a be a flat out hack,
and an ugly one at that.

> I find many things in IB are not intuitively obvious
> and I wanted to make sure I wasn't just missing the "right way" to click to
> select the window, or as you corrected the content view.

You shouldn't have to do anything to select the window. Do you not have the
standard handler installed?

>>> 3. I'm also a bit confused about signatures of controls within a window.  I
>>> thought I saw one of the documents (or header files) say that the signature
>>> should be the apps signature though I've never seen that used in any sample
>>> apps.
>>> 
>> I don't know why they say that. I don't know anyone who does it.
>> 
> Didn't make sense to me either.  I was fairly positive that I read this so I
> just went digging and found it again.  In the document windowscontrols.pdf on
> page 56 it says:

[...]

Yes, it says that. No one really does it though, not even Apple. File a
documentation bug against it.
> 
> This seems like a major overkill to try and have every control on every window
> be unique throughout the entire app.  Much simpler to just make controls
> unique to the window.

Correct.

Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Changing the signature of a window (From: Mike Lazear <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.