File: aboutdialog.rb

package info (click to toggle)
ruby-gnome 4.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 26,648 kB
  • sloc: ruby: 67,701; ansic: 67,431; xml: 350; sh: 201; cpp: 45; makefile: 42
file content (35 lines) | stat: -rwxr-xr-x 1,268 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env ruby
=begin
  aboutdialog.rb - Ruby/GTK sample script.

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

require "gtk3"

unless Gtk::Version.or_later?(3, 4, 2)
  puts "This sample requires GTK+ 3.4.2 or later: #{Gtk::Version::STRING}"
  exit
end

a = Gtk::AboutDialog.new
a.artists            = ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"]
a.authors            = ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"]
a.comments           = "This is a sample script for Gtk::AboutDialog"
a.copyright          = "Copyright (C) 2020 Ruby-GNOME Project"
a.documenters        = ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"]
a.license            = "This program is licenced under the same licence as Ruby-GNOME."
a.logo               = GdkPixbuf::Pixbuf.new(:file => File.join(__dir__, "gnome-logo-icon.png"))
a.program_name       = "Gtk::AboutDialog sample"
a.translator_credits = "Translator 1\nTranslator 2\n"
a.version            = "1.0.0"
a.website            = "https://ruby-gnome2.osdn.jp"
a.website_label      = "Ruby-GNOME Project Website"

a.signal_connect("activate-link") do |_widget, uri|
  p _widget.class
  p uri
end

p a.run