I'm wrestling with NSPathControl
. Specifically, I have a dialog (generated by a NIB) which asks the user for a title and a path. The path is supposed to be a local path on the user's hard drive. So, in Xcode 4, I dragged in an NSPathControl
. In the Attributes inspector, I set its style to "Pop Up".
This pretty much works like I expect. If I click it, I get a menu with a few common paths or paths related to the current selection, and a "Choose..." option which opens up a dialog box and allows a path selection.
The problem is, it doesn't look like a Cocoa dropdown, because there's no border or button stuff at all. How can I make this look more like an NSPopUpButton
, which is presumably what someone would expect.
Alternatively, I'm new to Cocoa and willing to be told I'm going about this the wrong way. If I'm going about it the wrong way, what's a better way to go about having the user select a path?
Here's an example of what I'm trying to do:
See the path dropdown? I would have expected it to look like one of these...
...but, that said, I'm trying to write a well-behaved Cocoa app, so what I really want is, "What's the right way to do this?" Thanks in advance.
The way I've done this before is by recreating the control myself using a highly customized NSPopUpButton
. I don't know of a better way. You should ask for one.