 |
 |
AppleScript Studio GUI Question
|
 |
|
 |
|
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status:
Offline
|
|
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
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2001
Location: NJ, USA
Status:
Offline
|
|
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...
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status:
Offline
|
|
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?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status:
Offline
|
|
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
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jul 2000
Location: Washington, DC
Status:
Offline
|
|
[bump]
Anyone? Someone asked the same question on the AppleScript Studio list, but no responses yet...
Kyle
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
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)tableView  NSTableView *)aTableView willDisplayCell  id)aCell forTableColumn  NSTableColumn *)aTableColumn row  int)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&t=001590
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|