Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make NSTableView transparent?

I want to make transparent NSTableView.
I am using WindowController class here.
I was trying this:

- (void)windowDidLoad
{
     [super windowDidLoad];
     [[self enclosingScrollView] setDrawsBackground: NO];
     [[self enclosingScrollView] setBorderType:NSNoBorder];

}

- (BOOL)isOpaque {

      return NO;
} 
- (void)drawRect:(NSRect)drawRect
{
     [super drawRect: drawRect];
}

But when i was writing this code i can't found enclosingScrollView in help window.
you can see here..

enter image description here

Any help?? Please remember me or correct me if i am doing something wrong.
Thank you.

like image 650
iUser Avatar asked Sep 15 '11 06:09

iUser


1 Answers

Got Answer..!!! I just tried this

[tableview setBackgroundColor:[NSColor clearColor]]; 
[tableview setHeaderView:nil]; 

and its working fine.. – – Snehal

Copied from comment in question, as its a bit buried...

like image 144
Tom Andersen Avatar answered Nov 16 '22 02:11

Tom Andersen