I'm looking at this a little more at the moment.  Three things concern me:

1) My NSButton instance that is supposed to become default button is enclosed 
within a small container view, so it is a little further down the view 
hierarchy than it might otherwise be. Ie the hierarchy is 
NSWindow/NSView/NSView/NSButton Does the NSButton somehow rely on being in the 
top view of a window? It seems like maybe it is trying to alter the view 
hierarchy from within its display routine. But I tried yanking the button out 
of the view hierarchy and moving it up a
level, inside the window's top-level view, and that didn't have any
effect --- still hung with the panel content displayed but the button empty.
2) The default button does not normally sit in the Key View loop, because only 
text fields/views do.  It's canBecomeKeyView is off and its 
acceptsFirstResponder is on. The initialFirstResponder is set to be this 
default button.  Problem occurs whether or not I set initialFirstResponder 
though.
3) Do I have the right configuration for the button?:
        [btn setButtonType:NSMomentaryPushInButton];
        [btn setBezelStyle:NSRoundedBezelStyle];


The setup is done before the panel is first made visible, right after setting 
up the key view loop.

If I put a breakpoint before the setInitialFirstResponder call, so that it 
stops immediately after setting up the button, then the panel is drawn (after a 
continue), except for the rectangle for this one button, which is still gray, 
with the system hung. With no breakpoint, the panel appears with the default 
button drawn in the same plain graphite look as the rest of the buttons (which 
are nested the same way, btw), and the app hangs when you mouse over it as it 
tries to redraw the button. 

Note that this is a display issue -- occurs regardless of how I make it the 
default button --- ie by setting the key equivalent or by making it default 
button cell.

FWIW, I also tried setting the controlTint of the button to try to make it look 
like a standard default button, but that had no effect whatsoever, apparently 
the value is not used.

I just don't know what the default-button behavior can depend on that I can 
have wrong. Ideas appreciated. Thanks


      
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to