Here is an example of how to use NSOpenPanel:
https://github.com/mattetti/pastis/blob/master/app/Pastis/filter_window_controller.rb#L145-160
- Mattdef browse(sender)dialog = NSOpenPanel.openPanel# Disable the selection of files in the dialog.dialog.canChooseFiles = false# Enable the selection of directories in the dialog.dialog.canChooseDirectories = true# Disable the selection of multiple items in the dialog.dialog.allowsMultipleSelection = false# Display the dialog and process the selected folderif dialog.runModalForDirectory(nil, file:nil) == NSOKButtonselection = dialog.filenames.firstlocation.stringValue = dialog.filenames.first.to_sendend
Hi all,
I've taken a look at the referred issue (#712), but I'm not sure of
the final implemented syntax. I'm trying to use a NSOpenPanel, so far
this is what I'm doing:
{{{
def loadSprite(sender)
@panel.beginSheetModalForWindow(@window, completionHandler:lambda { |code|
NSLog("code: #{code}")
})
end
}}}
what's the Right Way(tm) to use a NSOpenPanel?
thanks!
--
Rolando Abarca M.
Games For Food S.p.A.
http://www.gamesforfood.com
Phone: +1 (408) 345-5433
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel