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: cursors in windows



On Monday, August 18, 2003, at 05:30 PM, Bob Sabiston wrote:

Is there an easy way to have a cursor change when it is in a specific window? Up until now I have been using window regions and PtnInRgn() to determine which cursor to display. That means I have to add and subtract from the regions as various windows appear, disappear, and move around. And now I am having a strange problem where I go to move a window, and the cursor changes to the wrong thing as the window is being moved. Somewhere my window region calculation is getting screwed up.

>Take a look at the kEventWindowCursorChange event in CarbonEvents.h (available in Mac OS X and >CarbonLib 1.5 and later). I would say this would be the preferred method to use.


In Carbon.h it is not clear: By responding to that message it seems like you could change the cursor over a particular window--but if you want it to change back to the arrow when the user leaves the window, do you have to catch that message on *all* your other windows and set it back?

Install one handler on the app and another on all your windows.

When the app is called it'll be because the cursor is not over any window. I just call SetThemeArrowCursor(). When the window handler is called I get my window object and call object->DoWindowCursorChange()

So, your window's are not concerned with changing the cursor when it leaves the window -- only when its within the window. Your app handler will take care of things when moved out of any window at all.

Bryan
_______________________________________________
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: 
 >Re: cursors in windows (From: Bob Sabiston <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.