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: HIToolbars without a standard event handler



Tomas

I'm implementing a HIToolbar in my app, and I want to use my own Carbon event handlers to handle the toolbar instead of the standard event handler (which breaks some stuff for me). What kind of handlers should I register for to handle (hilite toolbar items, etc) the same stuff the standard handler does for toolbars, and what would those handlers do?

To get an HIToolbar to work in my PowerPlant app, I ended up using the standard handler but adding my own to avoid some of the breaking:


static const EventTypeSpec kStandardEvents[] = {
{ kEventClassWindow, kEventWindowClickContentRgn },
{ kEventClassWindow, kEventWindowDrawContent },
{ kEventClassWindow, kEventWindowUpdate }, // I don't see it called, but Apple uses it
{ kEventClassWindow, kEventWindowActivated },
{ kEventClassWindow, kEventWindowDeactivated },
{ kEventClassWindow, kEventWindowClose }, // Called while window still exists
{ kEventClassWindow, kEventWindowToolbarSwitchMode }
};


// We need the standard handler in order to get the toolbar to work. Unfortunately,
// this also messes up PowerPlant
s = ::InstallStandardEventHandler(::GetWindowEventTarget(window));
s = ::InstallWindowEventHandler(window, UndoStandardHandler,
GetEventTypeCount(kStandardEvents), kStandardEvents, this, &fUndoHandlerRef);
--


David Dunham     A Sharp, LLC
Voice/Fax: 206 783 7404     http://a-sharp.com
Efficiency is intelligent laziness.
_______________________________________________
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.