Skip to content

Instantly share code, notes, and snippets.

@treed
Created October 6, 2010 03:00

Revisions

  1. treed revised this gist Oct 6, 2010. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion file-chooser.rb
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,8 @@
    [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT])


    dialog.select_multiple = true
    if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT
    puts dialog.filename
    dialog.filenames.each do |name| puts name end
    end
    dialog.destroy
  2. treed created this gist Oct 6, 2010.
    13 changes: 13 additions & 0 deletions file-chooser.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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])


    if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT
    puts dialog.filename
    end
    dialog.destroy