From: Stefan S. <ma...@ss...> - 2015-09-26 21:47:10
|
On Tue, 2015-09-22 at 15:55 +0900, Kouhei Sutou wrote: > Hi, > > Ruby-GNOME2 project released Ruby-GNOME2 3.0.4: > http://ruby-gnome2.osdn.jp/hiki.cgi?News_20150922_1 > > It is the first release announce of 3.x series. There seems to be one more minor problem: I had def run_schematics_open_dialog dialog = Gtk::FileChooserDialog.new(:title => 'Open Files', :parent => self, :action => Gtk::FileChooserAction::OPEN, :buttons => COB) [['Schematics', '*.sch'], ['All Files', '*']].each{|n, p| filter = Gtk::FileFilter.new filter.name = n filter.add_pattern(p) dialog.add_filter(filter) } dialog.select_multiple = true names = nil #dialog.run do |response| #names = dialog.filenames.dup if response == Gtk::ResponseType::ACCEPT #end if dialog.run == Gtk::ResponseType::ACCEPT puts dialog.filenames.class puts dialog.filenames puts "filename = #{dialog.filename}" #puts "filenames = #{dialog.filenames}" puts "uri = #{dialog.uri}" end dialog.destroy names end with the "dialog.run do |response|" construct, which I took from an older example, maybe still GTK2. Now it does simple nothing, so I can not open files. In your package I found the "if dialog.run ==" code example. But it seems that the important point is, that dialog.filenames for multiple files simple do not work yet. I get /home/stefan/.gem/ruby/2.2.0/gems/gobject-introspection-3.0.6/lib/gobject-introspection/loader.rb:551:in `invoke': TODO: GIArgument(GSList)[filename] -> Ruby So we can open only single files now. Not a problem for me, but maybe good to report. On question: When the function should return the filename, is then a dup necessary like names = dialog.filenames.dup Best regards, Stefan |