• 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: [Q] Disabling an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Disabling an NSTableView


  • Subject: Re: [Q] Disabling an NSTableView
  • From: Dan Wood <email@hidden>
  • Date: Mon, 15 Jul 2002 17:32:16 -0700

My suggestion would be to loop through all the columns and setEditable: to NO, and set the text color of the data cells to gray, then setNeedsDisplay:YES.


On Monday, July 15, 2002, at 12:27 PM, Mark de Jong wrote:

I searched the archives for information telling me how to disable an NSTableView. What I found was several discussions including this question, but no answers.

I have a preference window that has two radio buttons and a table view. If one radio button is selected, the data in the table view should not be selectable or editable at all. If the other radio button is selected, then the table view becomes active and its data can be selected and edited.

When I send "setEnabled:NO" to my table, the table's visual appearance does not change and I can still select and edit all the items in the table. I would expect its appearance and behavior to change, similar to other controls.

Question 1: why is this so?
Question 2: how do I get the desired effect, mentioned above?

One possible workaround that comes to mind is to set both the table's delegate and datasource to nil and send "reloadData" to deactivate it. And then reconnect the delegate and datasource when re-activating it. This seems kind of gross, though ... and still will not achieve the visual "dimmed" or "grayed-out" appearance.

Thanks, in advance, for any clues and suggestions you can offer,

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



--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
_______________________________________________
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.

References: 
 >[Q] Disabling an NSTableView (From: Mark de Jong <email@hidden>)

  • Prev by Date: Re: Problems with netinfo/ni.h
  • Next by Date: Re: NSTableView header cell size
  • Previous by thread: [Q] Disabling an NSTableView
  • Next by thread: Comunications between classes
  • Index(es):
    • Date
    • Thread