Sha256: 1e8de6a018247d222b70452051990fb57c2703bc6ecd46f25c78a052dc842d1e

Contents?: true

Size: 1.25 KB

Versions: 35

Compression:

Stored size: 1.25 KB

Contents

#!/usr/bin/env ruby
=begin
  recentchooserdialog.rb - Ruby/GTK sample script.

  Copyright (c) 2006-2020 Ruby-GNOME Project Team
  This program is licenced under the same licence as Ruby-GNOME.
=end

require "gtk3"

dialog = Gtk::RecentChooserDialog.new(:title => "Recent Chooser Dialog Sample",
                                      :buttons => [["_Cancel", :cancel],
                                                   ["_Accept", :accept]])

dialog.signal_connect("response") do |_widget, response|
  case response
  when Gtk::ResponseType::ACCEPT
    info = dialog.current_item
    if info
      puts "----"
      puts info.uri
      puts info.display_name
      puts info.description
      puts info.mime_type
      puts info.added
      puts info.modified
      puts info.visited
      puts info.private_hint?
      p    info.get_application_info("gedit")
      p    info.applications
      puts info.last_application
      p    info.groups
      puts info.has_group?("web")
      puts info.has_application?("gedit")
      puts info.get_icon(64)
      puts info.short_name
      puts info.uri_display
      puts info.age
      puts info.local?
      puts info.exist?
    end
  else
    puts "Close"
    dialog.destroy
    Gtk.main_quit
  end
end
dialog.show_all

Gtk.main

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
gtk3-4.2.4 sample/misc/recentchooserdialog.rb
gtk3-4.2.3 sample/misc/recentchooserdialog.rb
gtk3-4.2.2 sample/misc/recentchooserdialog.rb
gtk3-4.2.1 sample/misc/recentchooserdialog.rb
gtk3-4.2.0 sample/misc/recentchooserdialog.rb
gtk3-4.1.9 sample/misc/recentchooserdialog.rb
gtk3-4.1.8 sample/misc/recentchooserdialog.rb
gtk3-4.1.7 sample/misc/recentchooserdialog.rb
gtk3-4.1.6 sample/misc/recentchooserdialog.rb
gtk3-4.1.5 sample/misc/recentchooserdialog.rb
gtk3-4.1.4 sample/misc/recentchooserdialog.rb
gtk3-4.1.3 sample/misc/recentchooserdialog.rb
gtk3-4.1.2 sample/misc/recentchooserdialog.rb
gtk3-4.1.1 sample/misc/recentchooserdialog.rb
gtk3-4.1.0 sample/misc/recentchooserdialog.rb
gtk3-4.0.9 sample/misc/recentchooserdialog.rb
gtk3-4.0.8 sample/misc/recentchooserdialog.rb
gtk3-4.0.7 sample/misc/recentchooserdialog.rb
gtk3-4.0.6 sample/misc/recentchooserdialog.rb
gtk3-4.0.5 sample/misc/recentchooserdialog.rb