Re: Can these be done in Cocoa?
Re: Can these be done in Cocoa?
- Subject: Re: Can these be done in Cocoa?
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 4 Jan 2002 17:10:52 +0100
On Friday, January 4, 2002, at 04:21 PM, Evan Coyne Maloney wrote:
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?
After having looked at something similar to this, I've been wondering if
the Controller/Code used in the NSOpenPanel can not be used in this
case. Since it's already coded and working well, it would be cool to
just have to use this code.
Maybe the HFS+ API are a better (and faster) solution that the APIs call
in the SimpleBrowser sample code. (one call missing in the NSFileManager
API is a way to see if a file is invisible or not (from the HFS point of
view)).
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?
You would need to implement this feature in your subclass of
NSBrowserCell I think.