diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-01-16 12:19:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-01-16 12:19:09 +0000 |
commit | 62e41d3f2e48422bbdf1bb2db83ae60b255b1a1a (patch) | |
tree | 4d0edb1c1986e1578b181ebe2441acfee27f1fab /ext/gtk/testa.rb | |
parent | 3db12e8b236ac8f88db8eb4690d10e4a3b8dbcd4 (diff) | |
download | ruby-62e41d3f2e48422bbdf1bb2db83ae60b255b1a1a.tar.gz |
Initial revision
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gtk/testa.rb')
-rw-r--r-- | ext/gtk/testa.rb | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/ext/gtk/testa.rb b/ext/gtk/testa.rb new file mode 100644 index 0000000000..00a6603dfd --- /dev/null +++ b/ext/gtk/testa.rb @@ -0,0 +1,78 @@ +require 'gtk' + +window = Gtk::Window::new(Gtk::WINDOW_TOPLEVEL) +window.set_title("toolbar test") +window.set_policy(TRUE, TRUE, TRUE) +window.signal_connect("destroy") do + exit +end +window.signal_connect("delete_event") do + exit +end +window.border_width(0) +window.realize + +toolbar = Gtk::Toolbar::new(Gtk::ORIENTATION_HORIZONTAL, Gtk::TOOLBAR_BOTH) +toolbar.append_item "Horizontal", "Horizontal toolbar layout", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil, + #window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_orientation Gtk::ORIENTATION_HORIZONTAL +end +toolbar.append_item "Vertival", "Vertical toolbar layout", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil, #window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_orientation Gtk::ORIENTATION_VERTICAL +end +toolbar.append_space +toolbar.append_item "Icons", "Only show toolbar icons", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil, #window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_style Gtk::TOOLBAR_ICONS +end +toolbar.append_item "Text", "Only show toolbar text", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil,#window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_style Gtk::TOOLBAR_TEXT +end +toolbar.append_item "Both", "Show toolbar icons and text", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil, #window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_style Gtk::TOOLBAR_BOTH +end +toolbar.append_space +toolbar.append_item "Small", "User small spaces", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil,#window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_space_size 5 +end +toolbar.append_item "Big", "User big spaces", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil,#window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_space_size 10 +end +toolbar.append_space +toolbar.append_item "Enable", "Enable tooltips", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil,#window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_tooltips TRUE +end +toolbar.append_item "Disable", "Disable tooltips", + Gtk::Pixmap::new(*Gdk::Pixmap::create_from_xpm(window.window, + nil,#window.style.bg[Gtk::STATE_NORMAL], + "test.xpm")), nil do + toolbar.set_tooltips FALSE +end +window.add toolbar +toolbar.show +window.show + +Gtk::main() |