• 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
Re: Problem with a tableview and image in the bg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with a tableview and image in the bg


  • Subject: Re: Problem with a tableview and image in the bg
  • From: Mike Ferris <email@hidden>
  • Date: Mon, 21 Jun 2004 07:40:30 -0700

You might want to look into the settings on your dataCells... It is
possible that the default dataCell for a tableColumn has its own
background drawing turned on.

Mike


Begin forwarded message:

> From: Fjolnir Asgeirsson <email@hidden>
> Date: June 20, 2004 10:29:33 PM PDT
> To: Apple CocoaDev <email@hidden>,
> email@hidden
> Subject: Problem with a tableview and image in the bg
>
> I'm having a problem with a tableView, it doesnt display the image
> underneath it when I set the bgcolor to clearcolor look here to see:
> http://freesci.linuxgames.com/tmp/abscreenshot.png
>
> Here's the source for my custom tableView:
> PlaylistTable.h:
> #import <Cocoa/Cocoa.h>
>
> @interface PlaylistTable : NSTableView
> {
> }
> - (BOOL)isOpaque;
> - (NSColor *)backgroundColor;
> - (void)drawRect:(NSRect)aRect;
> @end
>
> PlaylistTable.m
> #import "PlaylistTable.h"
>
> @implementation PlaylistTable
> - (BOOL)isOpaque
> {
> return YES;
> }
>
> - (NSColor *)backgroundColor
> {
> return [NSColor clearColor];
> }
>
> // Here I draw the background Image
> - (void)drawRect:(NSRect)aRect
> {
>
> NSString *imgPath = [[NSBundle mainBundle] pathForResource:@"gui2"
> ofType:@"tif"];
> NSImage *theImg = [NSImage imageNamed:imgPath];
> [theImg drawInRect:aRect
> fromRect:NSMakeRect(0,0,[theImg size].width,[theImg
> size].height)
> operation:NSCompositeSourceOver fraction:1.0];
> [super drawRect:aRect];
>
> }
> @end
>
> When I skip [super drawRect:aRect]; I can draw the image. I have
> defined a datasource for it and all.
>
> -Fjvlnir Asgeirsson
> -Aptiva
> _______________________________________________
> 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.
_______________________________________________
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.


  • Follow-Ups:
    • Re: Problem with a tableview and image in the bg
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >Problem with a tableview and image in the bg (From: Fjolnir Asgeirsson <email@hidden>)

  • Prev by Date: Re: NSSearchField not calling target
  • Next by Date: Re: Computed Columns in NSTableView
  • Previous by thread: Problem with a tableview and image in the bg
  • Next by thread: Re: Problem with a tableview and image in the bg
  • Index(es):
    • Date
    • Thread