Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ask_for_file(question)
- dialog = Gtk::FileChooserDialog.new(question, nil,
- Gtk::FileChooser::ACTION_OPEN,
- "gnome-vfs",
- [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT],
- [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL]
- )
- if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT
- file_name = dialog.filename.to_s
- return file_name
- else
- return nil
- end
- end
- path = ask_for_file("Test?")
- sleep(5)
- puts "continue with #{path}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement