| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 12/1/03 1:00 PM, "Jeffrey Mattox" <email@hidden> wrote:_______________________________________________
I'm experienced at mixing ASS with Cocoa and even Perl, but I've been
unable to figure out how to make new entries in a data source from
Cocoa. That is, I want to do this in Cocoa:
make new data row at end of the data rows of theDataSource
I'm able to access the table view and data source objects to Cocoa,
but I don't know the selector to use, as in:
call method "myCocoaRoutine:" with parameter theTableView
-(void)myCocoaRoutine:(NSTableView *)theTableView
{
id theDataSource;
dataSource = [theTableView dataSource];
[dataSource makeNewDataRow]; // <-- what is the proper selector?
...
}
My experience is that AppleScript data sources and Objective C ones don't
mix. data sources and their rows and columns are the _only_ things one can
'make new' as objects in Studio at present and, however they've been rigged
up, they don't appear to be accessible to call method. You can, however,
make your own subclasses NSObject files as custom data sources, and use call
method with them. The only reason for doing so would be to do things - for
example attributed strings in table views - that Studio data sources can't
do. in the above example, you don't (so far - I don't know what's coming
next) seem to need to do this at all. Why not just use the standard command
to 'make new data source' you quote in your first line.
If you really need a custom ObjC data source, then provide accessor methods
in the ObjC class file, and call that from Studio:
call method "myAddARow" of class "myCustomClass" with parameters
aListHere
You make your own ObjC method, or call the standard Obj methods in your
Cocoa file. That involves knowing about ObjC dictionaries, etc. which
perhaps you know already Check the NSTableDataSource protocol in the Cocoa
documentation - it's pretty good. Note that NSTableDataSource is a protocol,
not a class, of ApplicationKit, You'll find out everything you need there,
or from the Cocoa mailing list.
--
Paul Berkowitz
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.
| References: | |
| >Re: Making new data source rows from Cocoa (From: Paul Berkowitz <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.