Sha256: 46b2da84c7930ac0a9754c1e1af58cf7649b2b1bac3587dc161152d0eb69f0f8
Contents?: true
Size: 961 Bytes
Versions: 20
Compression:
Stored size: 961 Bytes
Contents
#!/usr/bin/env ruby begin require 'wx' rescue LoadError => no_wx_err begin require 'rubygems' require 'wx' rescue LoadError raise no_wx_err end end $wildcard = "Ruby Source (*.rb)|*.rb|RubyW Source (*.rbw)|*.rbw|All files (*.*)|*.*" module Demo def Demo.run(frame, nb, log) log.write_text("CWD: " + Dir.getwd() + "\n") dlg = Wx::FileDialog.new(frame, "Choose a file", Dir.getwd(), "", $wildcard, Wx::OPEN | Wx::MULTIPLE) if dlg.show_modal() == Wx::ID_OK paths = dlg.get_paths() log.write_text("You selected %d files" % + paths.length) paths.each {|path| log.write_text("CWD: " + path)} log.write_text("CWD: " + Dir.getwd()) end end def Demo.overview return "Welcome to the wxFileDialog Demo!" end end if __FILE__ == $0 run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb') load run_solo_lib run File.basename($0) end
Version data entries
20 entries across 20 versions & 1 rubygems