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: Playing nicely with OS and focus



On 27 Nov 2003, at 00:00, Cortis wrote:

Our product currently handles its own focus. This works great until users
turn on full keyboard access. Then the focus will toggle between all OS
controls but it misses all of our custom controls. After digging through
the documentation it seems clear that we need to be using calls like
"SetKeyboardFocus" etc, to be setting and clearing our focus.

Unfortunately we are getting errors like the following

errCouldntSetFocus = -30585,

I presume this is because the OS doesn't know that our control can get the
focus. Perhaps if it new this it would just work.

How do I tell the OS that my control can get the focus.

Do I use CreateCustomControl? What do I need to pass to that function so
that it knows that I can handle the focus.

Is there another way?

Use CreateCustomControl and RegisterToolboxObjectClass. When handling the kEventControlInitialize event, you need to set the kControlSupportsFocus feature in your control, and probably kControlGetsFocusOnClick as well. Then you need to handle the kEventControlGet/SetFocusPart events.

I can send some sample code off list.

Jerry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Playing nicely with OS and focus (From: Cortis <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.