[TxMt] Question on tm_dialog: NIB as table editor

Charilaos Skiadas cskiadas at gmail.com
Wed Feb 13 12:53:50 UTC 2008


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







More information about the textmate mailing list