Sha256: 4ee2c8a12c299832d3d205c7bdd965aa084a9209090a665f1bcad8ae1af696b6

Contents?: true

Size: 1.47 KB

Versions: 184

Compression:

Stored size: 1.47 KB

Contents

#!/usr/bin/env ruby
=begin
  toolbar.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: toolbar.rb,v 1.11 2006/06/17 13:18:12 mutoh Exp $
=end

require 'gtk2'

window = Gtk::Window.new("Gtk::Toolbar sample")

window.signal_connect("destroy") do
  Gtk.main_quit
end

toolbar = Gtk::Toolbar.new

toolbar.append("Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal",
  Gtk::Image.new("test.xpm")) do
  toolbar.orientation = Gtk::ORIENTATION_HORIZONTAL
end
toolbar.append("Vertical", "Vertical toolbar layout", "Toolbar/Vertical",
  Gtk::Image.new("test.xpm")) do
  toolbar.orientation = Gtk::ORIENTATION_VERTICAL
end
toolbar.append_space
toolbar.append("Icons", "Only show toolbar icons", "Toolbar/IconsOnly",
  Gtk::Image.new("test.xpm")) do
  toolbar.toolbar_style = Gtk::Toolbar::ICONS
end
toolbar.append("Text", "Only show toolbar text", "Toolbar/TextOnly",
  Gtk::Image.new("test.xpm")) do
  toolbar.toolbar_style = Gtk::Toolbar::TEXT
end
toolbar.append("Both", "Show toolbar icons and text", "Toolbar/Both",
  Gtk::Image.new("test.xpm")) do
  toolbar.toolbar_style = Gtk::Toolbar::BOTH
end
toolbar.append_space
toolbar.append("Enable", "Enable tooltips",nil,
  Gtk::Image.new("test.xpm")) do
  toolbar.tooltips = true
end
toolbar.append("Disable", "Disable tooltips",nil,
  Gtk::Image.new("test.xpm")) do
  toolbar.tooltips = false
end

window.add(toolbar)
window.show_all

Gtk.main

Version data entries

184 entries across 184 versions & 1 rubygems

Version Path
gtk2-3.4.3 sample/misc/toolbar.rb
gtk2-3.4.2 sample/misc/toolbar.rb
gtk2-3.4.1 sample/misc/toolbar.rb
gtk2-3.4.0 sample/misc/toolbar.rb
gtk2-3.3.9 sample/misc/toolbar.rb
gtk2-3.3.8 sample/misc/toolbar.rb
gtk2-3.3.7 sample/misc/toolbar.rb
gtk2-3.3.6 sample/misc/toolbar.rb
gtk2-3.3.5 sample/misc/toolbar.rb
gtk2-3.3.4 sample/misc/toolbar.rb
gtk2-3.3.3 sample/misc/toolbar.rb
gtk2-3.3.2 sample/misc/toolbar.rb
gtk2-3.3.1 sample/misc/toolbar.rb
gtk2-3.3.0 sample/misc/toolbar.rb
gtk2-3.2.9-x64-mingw32 sample/misc/toolbar.rb
gtk2-3.2.9-x86-mingw32 sample/misc/toolbar.rb
gtk2-3.2.9 sample/misc/toolbar.rb
gtk2-3.2.8-x64-mingw32 sample/misc/toolbar.rb
gtk2-3.2.8-x86-mingw32 sample/misc/toolbar.rb
gtk2-3.2.8 sample/misc/toolbar.rb