Re: Transparent NSTextField
Re: Transparent NSTextField
- Subject: Re: Transparent NSTextField
- From: Joel Norvell <email@hidden>
- Date: Thu, 28 Jun 2012 12:40:00 -0700 (PDT)
Hi Vincent,
Have you tried setDrawsBackground:NO on your NSTextField?
Below was what I used.
I don't know if any of the other instance variables I set are important for your case but they might be.
HTH,
Joel
- (void) initTextField;
{
[self setBordered:NO];
[self setFocusRingType:NSFocusRingTypeNone];
[self setBezelStyle:NSTextFieldSquareBezel];
[self setBezeled:NO];
[self setEnabled:YES];
[self setSelectable:YES];
[self setEditable:YES];
[self setAlignment:NSNaturalTextAlignment];
[self setBackgroundColor:[NSColor whiteColor]];
[self setDrawsBackground:NO];
}
This was the original message:
Hi everybody,
I’m trying to add a transparent editable NSTextField to a view. As long as the field is not editable (e.g. a label), everything is fine; but with an editable field, I get a background fill. I imagine this is under the window NSTextView responsibility. Has someone already succeeded in programming a totally transparent NSTextField, or shall I recourse to a CATextLayer instead?
Thanks,
Vincent
_______________________________________________
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