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 > AppleScript Studio GUI Question

AppleScript Studio GUI Question
Thread Tools
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Feb 13, 2002, 08:21 AM
 
How do I customize the look of a table. For the moment, mine rests plainm no lines, no altering color backgrounds for rows.

Plus, does anyone how to add a checkbox as a field or in a field in each row of the table?

The overall effect I'm looking for is similar to iTunes's table.

Kyle

How did it come to this? Goodbye PowerPC. | sensory output
     
Fresh-Faced Recruit
Join Date: Dec 2001
Location: NJ, USA
Status: Offline
Reply With Quote
Feb 13, 2002, 10:05 AM
 
Well, you can get the grid lines to show in Interface Builder by going to the Info Window (Tools menu, Show Info). Under options check "Show Grid". The other things you want to do may be able to be done programmatically, either through Applescript or Cocoa...

Steve W
Windows SysAdmin by day, OS X maniac by night...
     
krove  (op)
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Feb 15, 2002, 12:55 AM
 
Originally posted by swoodnj2:
<STRONG>Well, you can get the grid lines to show in Interface Builder by going to the Info Window (Tools menu, Show Info). Under options check "Show Grid". The other things you want to do may be able to be done programmatically, either through Applescript or Cocoa...

Steve W</STRONG>
How? I know it can be done, whether possible in AS Studio or cocoa remains to be seen...

Any one have cocoa suggestions perhaps?

How did it come to this? Goodbye PowerPC. | sensory output
     
krove  (op)
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Feb 15, 2002, 04:35 AM
 
I found this answer on the Cocoa dev list, but not being familiar with cocoam or obj-c, perhaps someone would care to translate for me?

The best way to do this is to implement the delegate method
tableViewWillDisplayCell and use the aCell passed in as an NSButton. Set the button type to NSButton.Switch and then after getting the state value from the data source underlying your table using the tableView, tableColumn and rowIndex passed in, use setState for the button you have created and then set the target appropriately if necessary.
:o

How did it come to this? Goodbye PowerPC. | sensory output
     
krove  (op)
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Feb 18, 2002, 03:08 AM
 
[bump]

Anyone? Someone asked the same question on the AppleScript Studio list, but no responses yet...

Kyle

How did it come to this? Goodbye PowerPC. | sensory output
     
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Feb 18, 2002, 06:08 AM
 
ok, this is the cocoa approach, no idea about applescript:

for the table background, do something similar to this:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (void)tableViewNSTableView *)aTableView willDisplayCellid)aCell forTableColumnNSTableColumn *)aTableColumn rowint)rowIndex
{
if ([aCell respondsToSelector:@selector(setBackgroundColor])
{
if (rowIndex % <font color = blue>2</font>)
{
[aCell setBackgroundColor:[NSColor whiteColor]];
} else {
[aCell setBackgroundColor:[NSColor colorWithDeviceRed:<font color = blue>0.75</font> green:<font color = blue>0.75</font> blue:<font color = blue>1.0</font> alpha:<font color = blue>1.0</font>]];
}
}
}
</font>[/code]

nsbuttoncells don't respond to setbackgroundcolor:, so you'd either have to live with the approach above or implement your own. as far as checkboxes are concerned, i've had the same question a while ago, here's the answer: http://forums.macnn.com/cgi-bin/ulti...4&amp;t=001590
     
   
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 12:41 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