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: DataBrowser HitTest-Crash with Custom Item



Christian,

The hit test and tracking callbacks are there so that the databrowser can support your custom column in a manner similar to the standard in built columns.

The whole point of a custom column is that you want to display some information within it that cannot be shown in a standard column, or you want to show data in a specific way.

As the DB has no idea what you are showing, or how you are showing it, user interaction with that column is delegated to you, because you do know what is in the column. This delegation is done through the custom callbacks.

The hit test handler is called when the user presses the mouse down in your column. It gives you enough information to determine which item was clicked and which property, in case you have more than one custom column.

Using the parameters given, you determine if the click requires more attention, and you return true, or if the click is totally unimportant and requires no further action, in which case you return false.

If you return true from the hit test, then the DB will call onto your track handler so that you can then get interactive with the user. For example, if your column content changes its appearance as the mouse moves over it. You normally stay within the tracking handler whilst the mouse is down, using a TrackMouseLocation[WithOptions] call.

Typically, if the mouse is released within an active part of your item, then you respond accordingly, and tell the DB to stop tracking. It is a while since I read the DB docs, so I apologise if I was incorrect about the specifics of what to return and when.

I hope this helps.

Douglas

On 14 Sep 2005, at 11:43, Christian Häusler wrote:

Yes, that was it.

But in the trackingCallback I return kDataBrowserStopTracking and it works
with my notificationCallback. I'm getting the select message.
This shouldn't happen or am I wrong?


Am 14.09.2005 um 11:13 schrieb Douglas Norton:


Christian,

You're getting there.

Change your hit test handler to return true.

Now install a tracking handler and always return the content hit result.

You should then get item selected messages in your notification callback.

I am a little bemused that TBrowser wants to call a tracking proc after you returned false in your hit proc.

Douglas

On 14 Sep 2005, at 07:59, Christian Häusler wrote:


I installed a HitTestCallback in my Databrowser and told him to always return
false. The log doesn't show a warning but the app still crashs.


The log says:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000100

Thread 0 Crashed:
0 <<00000000>> 0x00000100 0 + 0x100 //in the debugger this shows as '??'
1 com.apple.HIToolbox 0x929ae01c TBrowser::TrackItem (unsigned long, unsigned long, Rect&, Point, long, unsigned short) const + 0x50




my callback:

Boolean DataBrowserHitTestCallback (ControlRef browser,DataBrowserItemID itemID,
DataBrowserPropertyID property, const Rect *theRect,
const Rect *mouseRect) {


    return false;
}









_______________________________________________ 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
References: 
 >Re: DataBrowser HitTest-Crash with Custom Item (From: Laurence Harris <email@hidden>)
 >Re: DataBrowser HitTest-Crash with Custom Item (From: Christian Häusler <email@hidden>)
 >Re: DataBrowser HitTest-Crash with Custom Item (From: Douglas Norton <email@hidden>)
 >Re: DataBrowser HitTest-Crash with Custom Item (From: Christian Häusler <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.