Mailing Lists: Apple Mailing Lists

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

how to create live-tracking button?



Hi,

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?

Thanks,
Nick Jackiw
KCP Technologies


 _______________________________________________
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



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.