NSButton behavior
NSButton behavior
- Subject: NSButton behavior
- From: Herr Witten <email@hidden>
- Date: Sun, 20 Jun 2004 13:18:59 -0400
I programmatically created a button like this:
NSButton* button = [[[NSButton alloc] init] autorelease];
[button setTitle: @"Cancel"];
[button setTarget: self];
[button setAction: @selector(cancelSheet:)];
[button sizeToFit];
for a sheet. It gave me a NeXTish style button that worked just fine.
So, I figured I would beautify it with this:
[button setBezelStyle: NSRoundedBezelStyle];
and indeed the Aqua style button appeared, but the button border was
broken in the middle, shifted downward. I decided to sidestep the
problem by having the button be the default button so that it would
redraw itself with a pulse. I therefore added these calls:
[button setBezelStyle: NSRoundedBezelStyle];
[button setKeyEquivalent: @"\r"];
And voil`! The button appeared broken momentarily, but the pulsing
immediately redrew it. However, when I clicked on other buttons in the
sheet, the program hung, and when I just clicked the "Cancel" button,
the sheet disappeared, so I conjured another and closed it with the
"Cancel" button, which caused a hang--always on the second closing.
These problems do not occur with the NeXTish style button. Thanks for
any help.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.