Is there a way to override any form of button control or HIView so
that I can do live tracking while the button is being pressed, but
leave it up to the Toolbox to handle tracking and appearance of the
button between pressed and non-pressed states? My goal is a button
that performs a periodic action for as long as it's pressed (think:
"continuous zoom in").
The best I've come up with so far is to add a kEventControlClick
handler to an image-based-button created by CreatePictureControl()
or CreateBevelButtonControl(). I only get this event once per click
(immediately on mousedown). From there I could enter my own
stilldown loop using TrackMouseLocation, and do all of the mouse-
tracking and button redrawing myself using HITheme API and
HIViewDrawCGImage, while simulateously using a periodic timer to
fire tracking events to my actual logic. This seems close to
reimplementing a button's whole appearance and mouse-behavior logic
from scratch: all the ControlRef is doing is defining the
ControlBounds and sending me kEventControlClick. Am I missing
something obvious, or is this as good as it gets?
I think your kEventControlClick handler could simply install a timer,
call CallNextEventHandler (which will invoke the toolbox's default
tracking code and not return until the user releases the mouse), and
then remove the timer. Your timer will fire while the toolbox is
tracking the mouse in the control.
-eric
_______________________________________________
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