Re: Programmatically creating NSButton
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.