File: aboutdialog2.rb

package info (click to toggle)
ruby-gnome2 0.12.0-2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,820 kB
  • ctags: 7,421
  • sloc: ansic: 61,387; ruby: 17,307; makefile: 85; xml: 35; sql: 13
file content (44 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download
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
36
37
38
39
40
41
42
43
44
#!/usr/bin/env ruby
=begin
  aboutdialog2.rb - Ruby/GTK sample script.

  Copyright (c) 2005 Ruby-GNOME2 Project Team 
  This program is licenced under the same licence as Ruby-GNOME2.

  $Id: aboutdialog2.rb,v 1.1 2005/01/09 09:20:30 mutoh Exp $
=end
require 'gtk2'

Gtk.init

if str = Gtk.check_version(2, 6, 0)
  puts "This sample requires GTK+ 2.6.0 or later"
  puts str
  exit
end

Gtk::AboutDialog.set_email_hook {|about, link|
  p "email_hook"
  p link
}
Gtk::AboutDialog.set_url_hook {|about, link|
  p "url_hook"
  p link
}

Gtk::AboutDialog.show(nil,
		      "artists" => ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"],
		      "authors" => ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"],
		      "comments" => "This is a sample script for Gtk::AboutDialog",
		      "copyright" => "Copyright (C) 2005 Ruby-GNOME2 Project",
		      "documenters" => ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"],
		      "license" => "This program is licenced under the same licence as Ruby-GNOME2.",
		      "logo_icon_name" => "gtk-home",
		      "name" => "Gtk::AboutDialog sample",
		      "translator_credits" => "Translator 1 <no1@foo.bar.com>\nTranslator 2 <no2@foo.bar.com>\n",
		      "version" => "1.0.0",
		      "website" => "http://ruby-gnome2.sourceforge.jp",
		      "website_label" => "Ruby-GNOME2 Project Website"
		      )

Gtk.main