/GTK3 - AboutDialog
gem install gtk3
AboutDialog
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 <[email protected]>', 'Artist 2 <[email protected]>']
a.authors = ['Author 1 <[email protected]>', 'Author 2 <[email protected]>']
a.comments = 'This is a sample script for Gtk::AboutDialog'
a.copyright = 'Copyright (C) 2020 Ruby-GNOME Project'
a.documenters = ['Documenter 1 <[email protected]>', 'Documenter 2 <[email protected]>']
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
#!/usr/bin/env ruby
# frozen_string_literal: true
# aboutdialog2.rb - Ruby/GTK sample script.
#
# Copyright (c) 2005-2020 Ruby-GNOME Project Team
# This program is licenced under the same licence as Ruby-GNOME.
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
about_dialog = Gtk::AboutDialog.show(
nil,
'artists' => ['Artist 1 <[email protected]>', 'Artist 2 <[email protected]>'],
'authors' => ['Author 1 <[email protected]>', 'Author 2 <[email protected]>'],
'comments' => 'This is a sample script for Gtk::AboutDialog',
'copyright' => 'Copyright (C) 2005-2020 Ruby-GNOME Project',
'documenters' => ['Documenter 1 <[email protected]>', 'Documenter 2 <[email protected]>'],
'license' => 'This program is licenced under the same licence as Ruby-GNOME.',
'logo_icon_name' => 'gtk-home',
'program_name' => 'Gtk::AboutDialog sample',
'translator_credits' => "Translator 1 <[email protected]>\nTranslator 2 <[email protected]>\n",
'version' => '1.0.0',
'website' => 'https://ruby-gnome2.osdn.jp',
'website_label' => 'Ruby-GNOME Project Website'
)
about_dialog.signal_connect('delete_event') do
Gtk.main_quit
end
Gtk.main
Reference
이 문제에 관하여(/GTK3 - AboutDialog), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kojix2/items/2eac8a99d8c8a05fbf59텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)