• 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
Using a NSButtonCell with template image in a NSTableView, through Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using a NSButtonCell with template image in a NSTableView, through Interface Builder


  • Subject: Using a NSButtonCell with template image in a NSTableView, through Interface Builder
  • From: Eloy Duran <email@hidden>
  • Date: Fri, 8 Jan 2010 11:46:14 +0100

In Interface Builder, I have set the dataCell of one of the columns of my NSTableView instance to be NSButtonCell. This works as expected, however, trying to use a ‘template’ image doesn't yield the expected visual result when clicking the button.

How I configure the NSButtonCell:
• Image: NSRevealFreestandingTemplate
• Scaling: None
• Bezel: Bevel
• Type: Momentary Push In
• Bordered: false

Expected result when clicking the button:
• Since the image is a ‘template’, the button should render its ‘on’ state.
• The background, ie the space surrounding the image, should not change.


Actual result when clicking the button:
• No difference in the ‘state’ of the rendered image.
• The background color changes to white.

I've also played with changing the highlightsBy mask of the cell, but that didn't yield the expected result either.

Is the approach of using template images in this way even supported? (I could not find hard evidence for or against it in the docs.) Or should I resort to subclassing and write my own drawing code?

Even-though I’ve tried my best to make the explanation of the problem as concise as possible, I’ve also made a simple screencast [1] to visually illustrate the problem. And uploaded the demo app [2].

Eloy

[1] http://superalloy.nl/ImageButtonInTableView/ImageButtonInTableView.mov
[2] http://superalloy.nl/ImageButtonInTableView/ImageButtonInTableView.zip_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSPopupButton menu not showing in custom view for NSMenuItem
  • Next by Date: How do I know when a new object is added to an NSArray or NSCollectionView?
  • Previous by thread: Objective-C class generator for XML Schema
  • Next by thread: How do I know when a new object is added to an NSArray or NSCollectionView?
  • Index(es):
    • Date
    • Thread