Sha256: 8c13112bad6aad7523c55d48d5663636af0e1c3e2c3f01a0237d6bd602ec792f

Contents?: true

Size: 626 Bytes

Versions: 52

Compression:

Stored size: 626 Bytes

Contents

#!/usr/bin/ruby
# hello_gtk2.rb - sample for Ruby/GTK2
#
# Copyright (C) 2001-2006 Masao Mutoh
# This file is distributed under the same license as gettext.

require 'rubygems'
require 'gettext'
require 'gtk2'

class LocalizedWindow < Gtk::Window
  include GetText

  base_dir = File.dirname(__FILE__)
  bindtextdomain("hello_gtk2",
                 :path => File.join(base_dir, "locale"),
                 :output_charset => "utf-8")

  def initialize
    super
    signal_connect('delete-event') do
      Gtk.main_quit
    end

    add(Gtk::Label.new(_("hello, gtk world")))
  end
end

LocalizedWindow.new.show_all
Gtk.main

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
gettext-3.5.1 samples/hello_gtk2.rb
gettext-3.5.0 samples/hello_gtk2.rb
gettext-3.4.9 samples/hello_gtk2.rb
gettext-3.4.8 samples/hello_gtk2.rb
gettext-3.4.7 samples/hello_gtk2.rb
gettext-3.4.6 samples/hello_gtk2.rb
gettext-3.4.5 samples/hello_gtk2.rb
gettext-3.4.4 samples/hello_gtk2.rb
gettext-3.4.3 samples/hello_gtk2.rb
gettext-3.4.2 samples/hello_gtk2.rb
gettext-3.4.1 samples/hello_gtk2.rb
gettext-3.4.0 samples/hello_gtk2.rb
gettext-3.3.9 samples/hello_gtk2.rb
gettext-3.3.8 samples/hello_gtk2.rb
gettext-3.3.7 samples/hello_gtk2.rb
gettext-3.3.6 samples/hello_gtk2.rb
gettext-3.3.5 samples/hello_gtk2.rb
gettext-3.3.4 samples/hello_gtk2.rb
gettext-3.3.3 samples/hello_gtk2.rb
gettext-3.3.2 samples/hello_gtk2.rb