Mysterious hanging problem while drawing
Mysterious hanging problem while drawing
- Subject: Mysterious hanging problem while drawing
- From: Michael Domino <email@hidden>
- Date: Sat, 7 Mar 2009 08:53:50 -0500
Hi all,
Occasionally, and unpredictably, my app will hang at a
semaphore_wait_signal_trap, see the partial stack trace below. What's
happening is that I override NSButtonCell so I can draw a checkbox on
a parent row, and not on child rows. My NSButtonCell override, called
TableViewButtonCell, looks like this:
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
if(-1 < currentRow) {
SearchRowItem* anItem = static_cast<SearchRowItem*>([tableView
itemAtRow:currentRow]);
if(![anItem isChild]) {
[super drawWithFrame:cellFrame inView:controlView];
}
}
}
It my item is not a child, I allow the checkbox to be drawn, otherwise
I skip it. I set currentRow in my override of NSOutlineView (called
IDFOutlineView):
- (void)drawRow:(int)rowIndex clipRect:(NSRect)clipRect
{
// TableViewButtonCell doesn't know the current row when we draw;
this communicates it. TableViewButtonCell::drawWithFrame is just
downstream from here.
[TableViewButtonCell setCurrentRow:rowIndex];
[super drawRow:rowIndex clipRect:clipRect];
}
I set it up in my column prototype cell in my NSOutlineView
awakeFromNib like this:
TableViewButtonCell *tPrototypeCell = [[TableViewButtonCell alloc]
init];
[tPrototypeCell setTableView:tableView];
[tPrototypeCell setControlSize:NSMiniControlSize];
[tPrototypeCell setButtonType:NSSwitchButton];
[tPrototypeCell setTarget:self];
[tPrototypeCell setAction:@selector(toggleCheckbox:)];
[tCol setDataCell:[tPrototypeCell autorelease]];
Is that a reasonable method for doing a control in a column that
appears conditionally? Am I shooting myself in the foot somehow?
Thanks for your advice.
Here's the partial stack trace:
35 -
[NSView displayIfNeeded] + 933 (in AppKit) [0x94fab523]
35 -
[NSView
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] +
3090 (in AppKit) [0x9506ab4f]
35 -
[NSThemeFrame
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 306 (in AppKit) [0x9506e02b]
35 -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 4541 (in AppKit) [0x9506f5af]
35 -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 4541 (in AppKit) [0x9506f5af]
35
-[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 4541 (in AppKit) [0x9506f5af]
35
-[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 4541 (in AppKit) [0x9506f5af]
35
-[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 4541 (in AppKit) [0x9506f5af]
35
-[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView
:] + 1819 (in AppKit) [0x9506eb0d]
35
-[NSView _drawRect:clip:] + 3853 (in AppKit) [0x9507129c]
35
-[NSTableView drawRect:] + 2199 (in AppKit) [0x94fe0c84]
35
-[NSOutlineView drawRowIndexes:clipRect:] + 122 (in AppKit)
[0x94fe202a]
35
-[NSTableView drawRowIndexes:clipRect:] + 363 (in AppKit) [0x94fe21a0]
35
-[IDFOutlineView drawRow:clipRect:] + 132 (in Identity Finder)
[0x48e032]
35
-[NSTableView drawRow:clipRect:] + 872 (in AppKit) [0x9503cdb2]
35
-[NSOutlineView _drawContentsAtRow:column:withCellFrame:] + 99 (in
AppKit) [0x9503d7ea]
35
-[NSTableView _drawContentsAtRow:column:withCellFrame:] + 269 (in
AppKit) [0x9503d951]
35
-[TableViewButtonCell drawWithFrame:inView:] + 181 (in Identity
Finder) [0x48fe19]
35
-[NSButtonCell drawInteriorWithFrame:inView:] + 2054 (in AppKit)
[0x94ff46b5]
35
-[NSButtonCell
_configureAndDrawTitleWithRect:cellFrame:controlView:] + 4317 (in
AppKit) [0x953739d5]
35
-[NSButtonCell drawTitle:withFrame:inView:] + 187 (in AppKit)
[0x950d8844]
35
-[NSAttributedString(NSStringDrawingExtension)
_drawCenteredVerticallyInRect:scrollable:] + 2834 (in AppKit)
[0x950d937c]
35
__NSStringDrawingCore + 1694 (in AppKit) [0x94fda89f]
35
+[NSStringDrawingTextStorage
_fastDrawString:attributes:length:inRect:graphicsContext:baselineRendering:usesFontLeading:usesScreenFont:typesetterBehavior:paragraphStyle:lineBreakMode:boundingRect:padding:scrollable
:] + 3684 (in AppKit) [0x9504ca2b]
35
-[NSFont boundingRectForFont] + 63 (in AppKit) [0x950f0ac4]
35
_CTFontGetBoundingBox + 77 (in CoreText) [0x90313e75]
35
__ZNK5TFont14GetBoundingBoxEv + 65 (in CoreText) [0x90313edb]
35
__ZNK9TBaseFont14GetBoundingBoxEP7TStrike + 57 (in CoreText)
[0x90313fe1]
35
_GCGetStrikeInfo + 35 (in ATS) [0x964094a1]
35
_TSAcquireReader + 50 (in CarbonCore) [0x9197ab1a]
35
_semaphore_wait_signal_trap + 10 (in libSystem.B.dylib)
Michael Domino
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden