Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Mario Kušnjer
Again me ! Just a little update ! I packed previous code in combined message calls. Here's how it looks now: if ([lsOutlineView selectedRow] < 0) { Parent *parent = [Parent new]; <--- create new Parent object [sourceListLevelZero addObject:parent]; <--- add ne

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Mario Kušnjer
Hi all ! Thanks for your replies everybody ! I have reviewed my code according to yours inputs and I found where the problem was. Here's the reviewed code: if ([lsOutlineView selectedRow] < 0) { Parent *parent = [Parent new]; <--- create new Parent object

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Corbin Dunn
Mario, On Oct 5, 2009, at 4:44 PM, Mario Kušnjer wrote: > Hello to the list ! > > Request for help regarding a little problem. > So I have this piece of code: > > - (IBAction)addNewItem:(id)sender > { > if ([lsOutlineView selectedRow] < 0) > { > [sourceListLevelZero ad

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-05 Thread Charles Srstka
On Oct 5, 2009, at 7:49 PM, Colin Howarth wrote: On 6 Oct, 2009, at 01:44, Mario Kušnjer wrote: ... [lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex: [lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO]; It is the last line that trouble's me. It should select new

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-05 Thread Graham Cox
On 06/10/2009, at 10:44 AM, Mario Kušnjer wrote: [sourceListLevelZero addObject:[Parent new]]; [lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex: [lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO]; Assuming -addObject: in the first line adds th

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-05 Thread Colin Howarth
On 6 Oct, 2009, at 01:44, Mario Kušnjer wrote: ... [lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex: [lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO]; It is the last line that trouble's me. It should select newly added item in the list (right ?), but it does

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-05 Thread Stamenkovic Florijan
On Oct 05, 2009, at 19:44, Mario Kušnjer wrote: Hello to the list ! Request for help regarding a little problem. So I have this piece of code: - (IBAction)addNewItem:(id)sender { if ([lsOutlineView selectedRow] < 0) { [sourceListLevelZero addObject:[Parent new]

NSOutlineView - Automatically select newly added item - Help needed

2009-10-05 Thread Mario Kušnjer
Hello to the list ! Request for help regarding a little problem. So I have this piece of code: - (IBAction)addNewItem:(id)sender { if ([lsOutlineView selectedRow] < 0) { [sourceListLevelZero addObject:[Parent new]]; [lsOutlineView reloadItem:nil re