Sha256: 4ddd1e9102f1841124dd369398cc33739228098f72bbd17f5190a3f4a2dcc838

Contents?: true

Size: 1.04 KB

Versions: 38

Compression:

Stored size: 1.04 KB

Contents

#!/usr/bin/env ruby
=begin
  label.rb - Ruby/GTK2 sample script.

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

  $Id: label.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $
=end

require 'gtk3'

win = Gtk::Window.new("Gtk::Label sample")
win.signal_connect("destroy"){Gtk.main_quit}
label1 = Gtk::Label.new("_Not Use Mnemonic")
label1.selectable = true
label2 = Gtk::Label.new("_Use Mnemonic", true)
label3 = Gtk::Label.new.set_markup(%Q[<markup><span size="xx-large" weight="bold" foreground="blue"><u>Ruby-GNOME2</u></span> is <span foreground="red" size="x-large"><i>cool</i></span>!</markup>], true)
label4 = Gtk::Label.new.set_markup(%Q[<span foreground="#999900">_Not Use Mnemonic</span>])
label5 = Gtk::Label.new.set_markup(%Q[<span foreground="#009999">_Use Mnemonic</span>], true)

box = Gtk::Box.new(:vertical)
box.add(label1)
box.add(label2)
box.add(label3)
box.add(label4)
box.add(label5)
win.add(box).show_all

# This can be called after realized only.
label1.select_region(3, 8)

Gtk.main

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
gtk3-2.2.5-x64-mingw32 sample/misc/label.rb
gtk3-2.2.5-x86-mingw32 sample/misc/label.rb
gtk3-2.2.5 sample/misc/label.rb
gtk3-2.2.4-x64-mingw32 sample/misc/label.rb
gtk3-2.2.4-x86-mingw32 sample/misc/label.rb
gtk3-2.2.4 sample/misc/label.rb
gtk3-2.2.3-x86-mingw32 sample/misc/label.rb
gtk3-2.2.3 sample/misc/label.rb
gtk3-2.2.2-x86-mingw32 sample/misc/label.rb
gtk3-2.2.2 sample/misc/label.rb
gtk3-2.2.1-x86-mingw32 sample/misc/label.rb
gtk3-2.2.1 sample/misc/label.rb
gtk3-2.2.0-x86-mingw32 sample/misc/label.rb
gtk3-2.2.0 sample/misc/label.rb
gtk3-2.1.0-x86-mingw32 sample/misc/label.rb
gtk3-2.1.0 sample/misc/label.rb
gtk3-2.0.3-x86-mingw32 sample/misc/label.rb
gtk3-2.0.3 sample/misc/label.rb
gtk3-2.0.2-x86-mingw32 sample/misc/label.rb
gtk3-2.0.2 sample/misc/label.rb