Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to create a custom cursor using Carbon ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create a custom cursor using Carbon ?




On May 23, 2006, at 12:01 AM, Graeme Gill wrote:

It's not that complicated. For my particular window, I want to make
sure that the cursor can't get in front of it. So either the
cursor should be hidden whenever its in my window, or it should
switch to a transparent cursor. Having the window manager
switch the cursor is what I'd like, since I don't want to
have to create a thread to service window events.

Since Carbon does not support automatic cursor switching, let's consider approaches that allow you to do it manually. It does seem to me that you could implement this quite easily using two event handlers for kEventWindowCursorChange and kEventMouseMoved. Install these on the application event target. When you get the CursorChange event, check the window parameter in the event; if it's the window that should hide the mouse, then hide it with HideCursor(). When you get the MouseMoved event, you'll know that the mouse is not over one of your windows, so you can show the cursor with ShowCursor(). I wrote a quick test app that does this and, at a first approximation, it seems to work pretty well.


You mentioned in a previous message that when you clicked in the window, the cursor became visible again. I didn't see that problem for normal clicks in my test window, but I was just using standard HIToolbox controls. What kind of content does your window use - standard controls, or your own custom content?

-eric


_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to create a custom cursor using Carbon ? (From: Graeme Gill <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Eric Schlegel <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Graeme Gill <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Eric Schlegel <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Graeme Gill <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Eric Schlegel <email@hidden>)
 >Re: How to create a custom cursor using Carbon ? (From: Graeme Gill <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.