Hi,
I have a general question. Would it be possible to create a single NIB (without external Xcode) as a table editor? Given is a file containing TAB delimited data. These data should be sent to a tm_dialog NIB as plist. In principal this should work but the number of columns and rows can differ(?) The NIB file should contain an editable NSTableView and two buttons 'Cancel' and 'Save'. By pressing the button 'Save' the current content of the NSTableView should be outputted as plist. Is this possible?
Many thanks for any hint in advance.
Hans
I don't think there's a way to set the number of columns in an NSTableView via bindings. If you can live with a static number of columns, the rest is easy. You'll need to rewrite the tab-delimited data as entries in an array of dictionaries for the plist:
{nameOfColumn1 => row1valueForColumn1 ... nameOfColumnN => row1valueForColumnN}, {nameOfColumn1 => row2valueForColumn1 ... nameOfColumnN => row2valueForColumnN}...
And, in IB, bind the columns individually to "controller.nameOfColumnN".
Chris
On Feb 12, 2008, at 9:09 AM, Hans-Joerg Bibiko wrote:
Hi,
I have a general question. Would it be possible to create a single NIB (without external Xcode) as a table editor? Given is a file containing TAB delimited data. These data should be sent to a tm_dialog NIB as plist. In principal this should work but the number of columns and rows can differ(?) The NIB file should contain an editable NSTableView and two buttons 'Cancel' and 'Save'. By pressing the button 'Save' the current content of the NSTableView should be outputted as plist. Is this possible?
Many thanks for any hint in advance.
Hans
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 12 Feb 2008, at 20:12, Chris Thomas wrote:
I don't think there's a way to set the number of columns in an NSTableView via bindings. If you can live with a static number of columns, the rest is easy. You'll need to rewrite the tab-delimited data as entries in an array of dictionaries for the plist:
{nameOfColumn1 => row1valueForColumn1 ... nameOfColumnN => row1valueForColumnN}, {nameOfColumn1 => row2valueForColumn1 ... nameOfColumnN => row2valueForColumnN}...
And, in IB, bind the columns individually to "controller.nameOfColumnN".
Many thanks for the hint. My concern was whether this is possible in general ;) Regarding to the static numbers of columns, I could live with it, but a nib file contains three 'simple' plist files. Maybe it would be possible to modify these files at runtime. I don't know whether it works but at least I'll try it ;-O
Thanks,
Hans
On Feb 13, 2008, at 7:32 AM, Hans-Joerg Bibiko wrote:
On 12 Feb 2008, at 20:12, Chris Thomas wrote:
I don't think there's a way to set the number of columns in an NSTableView via bindings. If you can live with a static number of columns, the rest is easy. You'll need to rewrite the tab- delimited data as entries in an array of dictionaries for the plist:
{nameOfColumn1 => row1valueForColumn1 ... nameOfColumnN => row1valueForColumnN}, {nameOfColumn1 => row2valueForColumn1 ... nameOfColumnN => row2valueForColumnN}...
And, in IB, bind the columns individually to "controller.nameOfColumnN".
Many thanks for the hint. My concern was whether this is possible in general ;) Regarding to the static numbers of columns, I could live with it, but a nib file contains three 'simple' plist files. Maybe it would be possible to modify these files at runtime. I don't know whether it works but at least I'll try it ;-O
I would expect that once the NIB is in memory, changing those files won't have a direct effect. However, you can make the change, close the nib and load it again, and thus give the illusion of a variable number of columns (presumably the user would have to ask to add a column via a button or something? Then you can do this work in the callback)
Just guessing, but is this for basic data entry for the R bundle?
Thanks,
Hans
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 13 Feb 2008, at 13:53, Charilaos Skiadas wrote:
On Feb 13, 2008, at 7:32 AM, Hans-Joerg Bibiko wrote:
On 12 Feb 2008, at 20:12, Chris Thomas wrote:
I don't think there's a way to set the number of columns in an NSTableView via bindings. If you can live with a static number of columns, the rest is easy. You'll need to rewrite the tab- delimited data as entries in an array of dictionaries for the plist:
{nameOfColumn1 => row1valueForColumn1 ... Many thanks for the hint. My concern was whether this is possible in general ;)
Regarding to the static numbers of columns, I could live with it, but a nib file contains three 'simple' plist files. Maybe it would be possible to modify these files at runtime. I don't know whether it works but at least I'll try it ;-O
I would expect that once the NIB is in memory, changing those files won't have a direct effect. However, you can make the change, close the nib and load it again, and thus give the illusion of a variable number of columns (presumably the user would have to ask to add a column via a button or something? Then you can do this work in the callback)
With 'at runtime' I mean that I try to change the nib files BEFORE I load it with tm_dialog. The number of columns will be calculated by looking into the data file.
Just guessing, but is this for basic data entry for the R bundle?
;) Yes - as matrix/vector/data frame editor. But it could also be good for other purposes. Within the current Rdaemon bundle one can find a solution (marked by β) using an HTML form as table editor which works quite good, but for large matrices it is too slow.
--Hans