• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programmatically creating NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Programmatically creating NSButton
      • From: Greg Hulands <email@hidden>
References: 
 >Programmatically creating NSButton (From: Greg Hulands <email@hidden>)

  • Prev by Date: Re: NSTask output reading problem
  • Next by Date: Re: Programmatically creating NSButton
  • Previous by thread: Re: Programmatically creating NSButton
  • Next by thread: Re: Programmatically creating NSButton
  • Index(es):
    • Date
    • Thread