I’ve got an NSPopUpButton that’s used to choose a destination folder for files that are selected in a table, to be moved upon clicking a “Process Files” button. During early development (my first dive into an app that actually does something), I’m just using the folder names in the popup, but I got to thinking that if this ends up with other users, there’s no telling what they might end up filling this up with.
The problem comes in with the possibility of more than one folder with the same name (at a different path) ending up in the popup. I’m wondering what some of you might think about the best way to handle this?
I see a couple/few possibilities.
¢ One would be to use full paths in the popup, but that seems tacky (and a really wide button could run off of the containing view).
¢ I could set a fixed size for the popup button and actually use the full paths, having them truncate either head or middle, but that could even end up clipping the actual name of a folder if it’s long enough (I’m trying to avoid a really wide popup).
¢ Another would be to try to activate NSPopUpButtonWillPopUpNotification and change the items to the paths for selecting while popped up (if that’s possible to do on the fly). Once an item is selected, the title would then be reduced back to just the folder name in the end. This might be acceptable.
¢ I’ve seen that you can set a toolTip for the button, but nothing about the items. If it’s possible to have tooltips show when hovered over each item that pops up, then that could maybe work (displaying full paths), but I’m not holding my breath on that one. Right now I’m doing thing the hard way (as anyone experienced would probably see it) and just clearing the items and adding each item one by one, so at the moment I’m not binding to any real menus or array controllers or any of that. That comes later in my learning cycle. But if toolTips are available when loading the popup a different way, I guess I could go ahead and adjust. Probably not good HIG etiquette, anyway.
I’d like to avoid alternatives, like “ask list” dialogs or another table, if possible. I do want to allow same names from different paths, however, as this would be valid usage for this app.
Any ideas, thoughts, comments on what you would do if you were up against the same task?.. Thanks.
Dave.