|
|
NSTextView Transparent = Black ?
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
I'd like to make some NSTextViews transparent, so that I can see what's on the other NSTextViews behind them. However, setting them to 0% opacity in Interface Builder just makes them completely black when I run the application.
I'm guessing there is some view layer somewhere that I'm not aware of that is black and 100% opaque?
What is going on here, and how to I make my NSTextViews transparent without making them black?
(BTW, these NSTextViews are NOT within NSScrollViews).
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Sep 2003
Location: Nowhere, Missouri
Status:
Offline
|
|
Code:
[[textView enclosingScrollView] setDrawsBackground:NO];
[textView setDrawsBackground:NO];
That's the code I have. I know you said you didn't have a scroll view, but I believe that this also affects other view layers. I'd give it a shot, at least.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2003
Status:
Offline
|
|
Question: What, exactly, is the use for a text view without a scroll view and why are you using them? If you want one line unformatted input, simply use an NSTextField.
|
-- Devin Lane, Cocoa Programmer
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by Devin Lane:
Question: What, exactly, is the use for a text view without a scroll view and why are you using them? If you want one line unformatted input, simply use an NSTextField.
There are plenty of uses for text views without scroll views! I mainly use them for printing, where a scroll view is an unnecessary additional level of complication that just gets in the way (eg, [[[... enclosingScrollView] superview] superview]).
If you can guarentee that your NSTextView is of a fixed size that never needs to be scrolled, then why on earth would you want to put it in an NSScrollView? Yes, there are some situations where this is the case. I've come across plenty.
An NSTextField is not so versatile as an NSTextView, and is better suited, as you've said, to a single line of unformatted input.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
How did you create an NSTextView without a scroll view in IB? I don't see a palette for it anywhere.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Junior Member
Join Date: Sep 2003
Location: Nowhere, Missouri
Status:
Offline
|
|
He probably created it programatically. However, I believe you can use a custom view and set the class (using the inspector) to NSTextView. I haven't tried it, though.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by Chuckit:
How did you create an NSTextView without a scroll view in IB? I don't see a palette for it anywhere.
You simply add a generic NSView, and set it's class to be NSTextView. Of course this makes it impossible to do much else with it in IB. Which leads me on to a bit of a problem with my initial post...
On thinking about it, I've actually got my initial description a bit confused (although it doesn't affect the problem at hand). I did actually have it in a scroll view when setting the transparency in IB (but with scrollers hidden). At other times, I just had it as an NSView with custom subclass of NSTextView. Doesn't make much difference to my problem, as I've tried it both ways and had the same problem.
But I think, as posted above, "setDrawsBackground:" may be what I'm after, rather than tranparency a such (haven't had a chance to try it yet). I'll have a fiddle with this, when I get a chance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|