Re: CustomView Help ...
Re: CustomView Help ...
- Subject: Re: CustomView Help ...
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 14 Mar 2008 07:16:42 -0400
On 14 Mar 2008 11:07:55 +0000, Mic Pringle <email@hidden> wrote:
> I just dragged the label icon from the palette in IB onto my custom view ?
Ditch the NSTextField that you're currently using (that's what the
"label" is) and do the drawing yourself. AppKit does not support
overlapping views. Since you're tying the color of the view/text to
the drag operation, which happens in a separate runloop mode, you will
have more consistent results this way.
AppKit adds -drawWithRect:options:attributes to NSString in a
category. (See
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSString_AppKitAdditions/Reference/Reference.html
for documentation.) You want to use this in concert with
-sizeWithAttributes: to draw the string centered in your view.
HTH,
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden