Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Table views.. again.

Table views.. again.
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jul 7, 2002, 12:43 AM
 
OK, I am trying to get some code to get something other than a NSTextFieldCell as the data cell of a table column. According to the O'Reilly book (I know.. I know..) It says you can easily change it using setDataCell. So I figured [myColumn setDataCell:[NSButtonCell alloc]]; But further than that I'm not sure.. I've tried some things.. but I dunno. I think seb made a post about this a while ago.. but I just can't find it I also need to figure out how to get a NSProgressIndicator as the data cell of a column.. but I figured a check box in a table column would be a good start as I don't see a NSProgressIndicatorCell.. Thanks
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Jul 7, 2002, 01:18 AM
 
Simple. Do something like this to have a check box cell:
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">NSButtonCell *prototypeCell = [[[NSButtonCell alloc] initTextCell: @&quot;&quot;] autorelease];
[prototypeCell setButtonType:NSSwitchButton];
[prototypeCell setImagePosition:NSImageOnly];
[myColumn setDataCell: prototypeCell];</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Jul 7, 2002, 01:22 AM
 
Oh, and by the way, you cannot set a progress indicator to be the data cell of a column. NSButton inherits from NSControl, which means it has to have a corresponding cell, while NSProgressIndicator inherits directly from NSView. So...the only way to set a progress indicator as a table column cell is to create your own--there are a few open-source applications which use this.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2