• 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
[Q] Image background color different from NSTableView's background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] Image background color different from NSTableView's background color


  • Subject: [Q] Image background color different from NSTableView's background color
  • From: Mark de Jong <email@hidden>
  • Date: Thu, 30 May 2002 10:29:57 -0700

Hi!

I have a window with an NSTableView in it. I set the background of this view to a solid color using the setBackgroundColor: selector.

One of the columns in the NSTableView displays NSButtons whose NSCell is an NSImage.

I setup the button view with the following in the "windowDidLoad" delegate:

[myTableColumn setDataCell: [[NSButtonCell alloc] initImageCell:nil]]

where "myTableColumn" is an NSTableColumn.

Later, in the table delegate "tableView:willDisplayCell:forTableColumn:row:", I place the appropriate NSImage in the cell with:

[aCell setImage:myImage01]

The NSImages are all tiffs that have alpha channels.

The buttons and images display and are functional, with one caveat: the background color surrounding the button is the standard "horizontal striped" background rather than the solid background color set in "windowDidLoad".

In response to Stiphane Sudre's comment, I added:

[[myTableColumn dataCell] setButtonType: NSMomentaryChangeButton];

This seems to fix things in an NSOutlineView, but not in an NSTableView.

How do I ensure the button's background is the same as my table's background?

Thanks,

-- Mark de Jong
_______________________________________________
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.

  • Prev by Date: Re: Changing from single document to document based application
  • Next by Date: Re: NSURL question (not so easy (i think))
  • Previous by thread: Re: [Q] Image background color different from NSTableView's background color
  • Next by thread: first attempt at delegation failing
  • Index(es):
    • Date
    • Thread