'Strange' issue with NSOutlineView in NSMenuItem
'Strange' issue with NSOutlineView in NSMenuItem
- Subject: 'Strange' issue with NSOutlineView in NSMenuItem
- From: Marcel Trapman <email@hidden>
- Date: Mon, 13 Apr 2009 18:03:03 +0200
Hi,
I have set up an application as 'menuling' (if I am correct).
For that I have created a menu in a nib file as well as an outline view.
I linked the view of one of the menuitems to the outline view.
Following that I have created a doubleclick method and linked that to
the doubleclick action of the view.
The action and all other things work perfectly fine. When the method
receives the action the selected row is determined, the item extracted
and based on the information a url is opened in the default browser.
So far so good.
However, when I go back to the menu I can not select any row in the
outline view anymore. I can collapse/expand the items but there is no
way that I can select the row.
This remains so until I show a window from the menu and close the
window. After that I can again select a row.
That made me think it has to do with either the fact that the
application/menuling has no focus anymore or that the outline view is
not enabled.
I think the first because, when I do not open a url everything works
as expected.
Has anybody any idea how to solve this?
I set up the double click even as follows:
-----
[outlineView setTarget:self];
[outlineView setDoubleAction:@selector(outlineViewDoubleClicked:)];
-----
And this is the event:
-----
NSInteger selectedRow = [sender selectedRow];
if (selectedRow != -1) {
@try {
id item = [sender itemAtRow:selectedRow];
[sender deselectRow:selectedRow];
[[NSWorkspace sharedWorkspace] openURL:[[NSURL alloc]
initWithString:[item objectForKey:@"link"]]];
}
@catch (NSException * e) {
NSLog(@"%@", e);
}
}
-----
I hope somebody can help me with this.
Thanks,
Marcel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden