On Thursday, October 24, 2002, at 01:55 AM, Rich Morin wrote:
The same topic, although not in Perl, came up relatively recently on the cocoa-dev list. The answer was, it's done with Carbon, and odd as it may sound, contextual menus are implemented as COM objects - yes, COM objects, as in Windows.I'm interested in registering a Camelbones app as an item that will show up whenever the user control-clicks on a folder or a document (ala Path Finder and BBEdit). Clues, anyone?
Take a look at Menus.h. Also, search Apple's Carbon dev list for "Contextual Menu Workshop."
You might be able to do something with an XS extension, or with Inline::C, but either way, it's not going to be anywhere near as easy as using a native Cocoa object.
The widget you're looking for is an NSOutlineView, and if you've got the developer docs installed in the default location, there should be docs for it here:I am also interested in finding out how to create something that looks quite a bit like the Finder's "View as List" widget. That is, I'd like to have a columnar display with disclosure triangles, sorting by column, etc. Is there any example code (ObjC would do) that might show me how to do this?
<URL: file:///Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/OutlineView/
index.html>
There's someone working on a tutorial for using NSOutlineView in CamelBones, but he's not finished it yet. The tutorial, that is - his code is working. He's actually working on several tutorials, and they're pretty good stuff - I'll be linking to them from the CamelBones site when they're ready for prime time.
It's pretty much the same as using an NSTableView, so you can take a look at the "Data Access" example provided with CamelBones to help get you started. The difference is that the methods implemented by the data source are a bit different, because of the hierarchical nature of the data.
sherm--
If you listen to a UNIX shell, can you hear the C?
