Skip to content

Instantly share code, notes, and snippets.

@treed
Created October 6, 2010 03:00
Show Gist options
  • Save treed/612736 to your computer and use it in GitHub Desktop.
Save treed/612736 to your computer and use it in GitHub Desktop.
require 'gtk2'
dialog = Gtk::FileChooserDialog.new("Open File",
nil,
Gtk::FileChooser::ACTION_OPEN,
nil,
[Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
[Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT])
dialog.select_multiple = true
if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT
dialog.filenames.each do |name| puts name end
end
dialog.destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment