• 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: adding a new BezelStyle to buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding a new BezelStyle to buttons


  • Subject: Re: adding a new BezelStyle to buttons
  • From: Nicholas Francis <email@hidden>
  • Date: Wed, 7 Jan 2004 02:11:11 +0100

Thanks for the heads-up...

I did indeed end up subclassing several NSCell subclasses (intercepting setBezelStyle on the way), and moving all my drawing code to a utility class...

Now Im looking for how to substitute my cells when loading nibs - something with NSCoder, but that's about as far as I've gotten with The Fine Manual ;-)

Nicholas

On Jan 7, 2004, at 1:42 AM, Andrew Platzer wrote:

On Jan 4, 2004, at 3:32 AM, Nicholas Francis wrote:
I'm looking for ways to add a new BezelStyle to the list currently supported by NSButton & NSPopUpButton. I can easily live with not being able to set it from IB, but would like to not have to create a new Cell type and set the cell for all my controls from code.

Something like this would be nice:
static const int myBezelStyle = 9600; // Strange magic value

- (void) awakeFromNib {
[myButton setBezelStyle: myBezelStyle];
[myPopupButton setBezelStyle: myBezelStyle];
}

Would there be any way to catch this bezelStyle inside a cell's call - (void)drawWithFrame:inView: and then check for the myBezelStyle?

I wouldn't recommend this. The bezel style is stored in only 4 bits (16 values) and Cocoa uses 0..9 right now. The others are reserved and subject to use without notice. Using a value of 9600 would definitely fail.

Besides, how would you do your custom drawing without subclassing NSCell and overriding -drawWithFrame:inView:?

Andrew
_______________________________
Andrew Platzer
Application Frameworks
Apple Computer, Inc.
_______________________________________________
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.

References: 
 >adding a new BezelStyle to buttons (From: Nicholas Francis <email@hidden>)
 >Re: adding a new BezelStyle to buttons (From: Andrew Platzer <email@hidden>)

  • Prev by Date: NSView Background
  • Next by Date: Re: NSSpellServer & period
  • Previous by thread: Re: adding a new BezelStyle to buttons
  • Next by thread: XCode: disabling Run log window
  • Index(es):
    • Date
    • Thread