Image within Textfield - Show Editor at correct
position



Hi,

I want to implement a Textfield that shows an image at the left side, just like the addressbar in Safari. Therefore I subclassed NSTextFieldCell and overrode
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView.
It draws the image and then calls super with a frame somewhat further on the right. All this works just fine, but when I am going to edit the TextFiled, the overridden Function is not called and teh Text is edited on the very left of the Textfield, above the Image.

I further tried overriding
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart length:(int)selLength
and
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent.
In the Implementation I moved the aRect somwhat left. The editor now is shown at the correct position but the FocusRing does not cover the complete textfield but it is somewhat shorter on the left side.

Can anybody help me with this issue?

Thanks in advance,
Stefan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

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:
http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us

This email sent to maillists@xxxxxxxxx

...



Privacy