Re: Programmatically creating NSButton
Re: Programmatically creating NSButton
- Subject: Re: Programmatically creating NSButton
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 24 Apr 2004 13:58:39 +0100
On 24 Apr 2004, at 4:43 am, Greg Hulands wrote:
Hi,
I am trying to create a rounded aqua button, but the text in the button
seems to be positioned at the bottom of the button, not in the center.
[aqua setButtonType:NSMomentaryPushButton];
[aqua setBordered:YES];
[aqua setBezelStyle:NSRoundedBezelStyle];
[aqua setImagePosition:NSNoImage];
[aqua setAlignment:NSCenterTextAlignment];
What am I doing wrong?
Nothing obvious. Some suggestions, though. Try sending all these
methods (except -setBordered:) to [aqua cell] instead of the button
itself. Also, try leaving out -setAlignment: altogether. I've found
with programmatically created buttons that they don't always display
properly unless these methods are sent to the button cell. (Also, you
shouldn't need to -setBordered:YES, since buttons are bordered by
default.)
Hope this helps.
-Jeremy
===================================
SkoobySoft, home of viJournal
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================
_______________________________________________
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.