• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SOLVED : Transparent NSTableView. Is it possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED : Transparent NSTableView. Is it possible?


  • Subject: SOLVED : Transparent NSTableView. Is it possible?
  • From: Andrei Tchijov <email@hidden>
  • Date: Thu, 18 Aug 2005 12:24:34 -0400

Excellent!!!  It works like a charm. Thanks a lot Todd.

In case some one else wants to know exactly what needs to be done step by step.

1) In IB subclass NSTableView class. Name it the way you like it (for example TransparentTableView)
2) Make IB to generate files for this class and add these files to you project.
3) Copy following code into TransparentTableView.m file


- (void)awakeFromNib {

    [[self enclosingScrollView] setDrawsBackground: NO];
}

- (BOOL)isOpaque {

    return NO;
}

- (void)drawBackgroundInClipRect:(NSRect)clipRect {

    // don't draw a background rect
}

4) Now in the IB Inspector for ANY NSTableView object on "Custom Class" page you should see TransparentTableView entry. Select it to make any table in your GUI transparent.

NOTE: Same approach works for NSOutlineView.

Keywords: NSTableView NSOutlineView transparent background

On Aug 18, 2005, at 11:32, Todd Ransom wrote:

Andrei,

I just looked at this and there is not much to it so I will just post it here rather than creating an example project, etc.

You just need to override a couple of methods and set your scroll view to be transparent when you awakeFromNib.

==========================

- (void)awakeFromNib {

    [[self enclosingScrollView] setDrawsBackground: NO];
}

- (BOOL)isOpaque {

    return NO;
}

- (void)drawBackgroundInClipRect:(NSRect)clipRect {

    // don't draw a background rect
}



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Transparent NSTableView. Is it possible? (From: Andrei Tchijov <email@hidden>)
 >Re: Transparent NSTableView. Is it possible? (From: Todd Ransom <email@hidden>)
 >Re: Transparent NSTableView. Is it possible? (From: Andrei Tchijov <email@hidden>)
 >Re: Transparent NSTableView. Is it possible? (From: Todd Ransom <email@hidden>)

  • Prev by Date: Re: Do I need to release IBOutlets in dealloc?
  • Next by Date: Re: Since when does caling [NSTimer invalidate] release the object that spawned it?
  • Previous by thread: Re: Transparent NSTableView. Is it possible?
  • Next by thread: Re: Transparent NSTableView. Is it possible?
  • Index(es):
    • Date
    • Thread