Can these be done in Cocoa?
Can these be done in Cocoa?
- Subject: Can these be done in Cocoa?
- From: Evan Coyne Maloney <email@hidden>
- Date: Fri, 4 Jan 2002 10:21:37 -0500
Hello,
I'm working on a Cocoa project that includes a file browser. I'm trying to
get the file browser to resemble that of Finder, but am having a few issues
that don't seem addressable in Cocoa:
1. In my first column, I'd like to present a list of the volumes currently
mounted. I'm able to determine what the UNIX mount points of the volumes
are using NSWorkspace's mountedLocalVolumePaths method. I use this to get
the icon for each volume using NSWorkspace's iconForFile method, and I
assume that the last path portion of each mount point within /Volumes is
the name of the volume itself. (As it seems to be for every test case I've
come up with thusfar.) However, the boot-up hard drive itself is mounted
simply as "/", so my method of determining the volume name does not work in
this case. I've searched every relevant Cocoa class I can find, but I don'
t see any methods for returning volume names. Can anyone point me in the
right direction?
2. I've noticed that the NSBrowser does not automatically truncate text by
placing elipses in the middle or at the end of the text that appears in
each NSBrowserCell. I'd like to do this, and would prefer to do so using
some OS-level mechanism (rather than doing it manually) in case the user is
allowed to tweak the setting in the future. What is the normal mechanism
for doing this?
3. I'd like the column widths in my file browser to be resizable by the
user as Finder allows, but the default NSBrowser does not seem to provide
this. I believe I read somewhere that Finder is a Carbon-based, not Cocoa,
so perhaps this functionality is provided only by the Carbon equivalent of
NSBrowser. If this is done easily under Cocoa, does anybody know of any
good examples/references for doing this?
My controller for the file browser is written in Java, but I'd be happy to
move it to Objective-C, which I may need to do, because I've got a
suspicion that Carbon calls will be required for some of this.
Thanks in advance for any assistance you can provide!
P.S. This is my first post to any mailing list about Mac programming since
1995. OS X brought me back, and I'm glad it did, because the Mac feels like
home.
Evan Coyne Maloney____________________________________________________
The six-legged fire-breathing dog email@hidden