• 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: "Louis C. Sacha" <email@hidden>
  • Date: Sat, 24 Apr 2004 18:44:44 -0700

Hello...

...
The only thing I can think of is that a NSButtonCell requires
information from the NSButton to draw itself correctly, but this
doesn't seem right as it would defeat the purpose of cells.

Baffling, Bloody Baffling I tell you!

Greg


Drawing text is something that requires knowledge of specifics from the view that is being drawn into (which doesn't have to be any particular kind of NSView, so it doesn't "defeat the purpose of cells").

Have you tried passing the actual focused view to the cell when you are drawing instead of nil (I haven't been following this thread, so someone might have suggested it already)?

[btn drawWithFrame:frame inView:[NSView focusView]];

Even if you are drawing into an image, there is a view where the drawing is occuring...


If that doesn't work, you could also just use a whole NSButton view with it's button cell, and the use the NSView printing methods of the NSButton to get the image data in EPS or PDF form, and then you could do whatever you want with that data.


Hope that helps,

Louis
_______________________________________________
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: 
 >Re: Programmatically creating NSButton (From: Jeremy Dronfield <email@hidden>)
 >Re: Programmatically creating NSButton (From: Greg Hulands <email@hidden>)

  • Prev by Date: Re: NSTimer crashing on fire
  • Next by Date: NSArchiver and tableView icons
  • Previous by thread: Re: Programmatically creating NSButton
  • Next by thread: Re: Programmatically creating NSButton
  • Index(es):
    • Date
    • Thread