Re: Default "transparent" background
Re: Default "transparent" background
- Subject: Re: Default "transparent" background
- From: Simon Stapleton <email@hidden>
- Date: Tue, 3 Dec 2002 18:40:11 +0100
Buddy Kurz wrote:
Depending on your needs you may also use [NSColor
windowBackgroundColor] which returns an NSPatternColor that will draw
the ruled lines.
On Tuesday, December 3, 2002, at 07:20 AM, Jonathan E. Jackel wrote:
Try filling the view with [NSColor clearColor].
Jonathan
I have a view filled with white color. How can I erase that color
and leave the view with it's default background (gray horizontal
lines ) ?
As long as your view is a custom one, and you want it to always have
the 'window' background, you might well want to look into using
NSDrawWindowBackground() in your view's -drawRect: something like this:
- (void) drawRect: (NSRect) aRect {
NSDrawWindowBackground(aRect);
// Do some other drawing here
}
If you're into changing the display of 'standard' (i.e. NS*) views,
then you'll have to do something different, of course.
NSTextView, for example, has a -setDrawsBackground: selector which
might be handy if you're futzing with a text view. NSTableView has a
-setBackgroundColor: selector that might well be useful, if that's what
you're using. etc...
For generic views (i.e. it's defined as an NSView, or id, but you don't
know what type it will have at runtime) I can't think of an easy way to
do it at the moment.
Simon
--
PGP Key Id : 0x50D0698D
--
Your mouse has moved. You must restart Windows NT for this change to
be recognised.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.