Re: NSTextField, drawing the text offset to the right in the field
Re: NSTextField, drawing the text offset to the right in the field
- Subject: Re: NSTextField, drawing the text offset to the right in the field
- From: jon <email@hidden>
- Date: Tue, 29 Sep 2009 17:43:22 -0600
i've got something i think is close...
i've got a custom cell, and a custom textfield,
i've got an override implementation of "drawInteriorWithFrame" that i
think will work.
but i'm confused as to where to call "drawInteriorWithFrame", right
now it is inside the custom Cell, but the custom textfield never
calls it as i believe it should?
right now
-------------------------------------------------------
IBOutlet ImageTextField *addressBar;
-------------------------------------------------------
[addressBar setStringValue:urlString];
is properly using my custom textfield, but the custom textfield
doesn't appear to be using the custom cell... (or atleast the new
drawInteriorWithFrame is not being called)
(i have not overriden the "setStringValue") Maybe this isn't the
right call, and it is bypassing "drawInteriorWithFrame"?
the only connection between custom textfield and the custom cell is
#import "ImageTextFieldCell.h"
is inside the header of the custom textfield.
does there need to more connection to it? or how would i get this
call to the new drawInteriorWithFrame?
the running app shows the text field filled in properly (just not
offset, as the override implementation of drawInteriorWithFrame would
have done) , so it must have called the super of it somewhere.
thanks for the help in advance.
Jon.
On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:
On Mon, 28 Sep 2009 19:37:00 -0600, jon <email@hidden> said:
i've got a textfield defined...
but i don't want to draw the text that is in the field right up
against the left boarder of the bounding box of this defined field in
IB,
I want to start the text like 20 pixels to the right of the left
boarder and still have the nicely defined frame of the field in it's
original place...
What I do is have the textfield replace its cell by a custom cell that
implements drawInteriorWithFrame, such as to inset its frame rect as
it
calls super. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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