diff options
author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-21 09:04:58 +0000 |
---|---|---|
committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-21 09:04:58 +0000 |
commit | 015a676b4bdb946bae73ba73f8230c61c9047d8c (patch) | |
tree | 293d751eea745304b12b48ea3b6e1e82700cab87 /ext/gtk/test2.rb | |
parent | 8ef071c882218ff2d9f00f51f55e872343776104 (diff) |
This commit was manufactured by cvs2svn to create tag 'v1_2_2'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_2_2@377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gtk/test2.rb')
-rw-r--r-- | ext/gtk/test2.rb | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/ext/gtk/test2.rb b/ext/gtk/test2.rb deleted file mode 100644 index 33215b7f7a..0000000000 --- a/ext/gtk/test2.rb +++ /dev/null @@ -1,89 +0,0 @@ -require 'gtk' - -window = Gtk::Window::new(Gtk::WINDOW_TOPLEVEL) -window.set_title("list") -window.border_width(0) - -box1 = Gtk::VBox::new(FALSE, 0) -window.add(box1) -box1.show - -box2 = Gtk::VBox::new(FALSE, 10) -box2.border_width(10) -box1.pack_start(box2, TRUE, TRUE, 0) -box2.show - -scrolled_win = Gtk::ScrolledWindow::new() -scrolled_win.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC) -box2.pack_start(scrolled_win, TRUE, TRUE, 0) -scrolled_win.show - -list = Gtk::List::new() -list.set_selection_mode(Gtk::SELECTION_MULTIPLE) -list.set_selection_mode(Gtk::SELECTION_BROWSE) -scrolled_win.add(list) -list.show - -for i in [ - "hello", - "world", - "blah", - "foo", - "bar", - "argh", - "spencer", - "is a", - "wussy", - "programmer", - ] - list_item = Gtk::ListItem::new(i) - list.add(list_item) - list_item.show -end - -button = Gtk::Button::new("add") -button.set_flags(Gtk::CAN_FOCUS); -i = 1 -button.signal_connect("clicked") do - list_item = Gtk::ListItem::new(format("added item %d", i)) - list.add(list_item) - list_item.show - i += 1 -end -box2.pack_start(button, FALSE, TRUE, 0) -button.show - -button = Gtk::Button::new("remove") -button.set_flags(Gtk::CAN_FOCUS); -button.signal_connect("clicked") do - tmp_list = list.selection - list.remove_items(tmp_list) - for w in tmp_list - w.destroy - end -end -box2.pack_start(button, FALSE, TRUE, 0) -button.show - -separator = Gtk::HSeparator::new() -box1.pack_start(separator, FALSE, TRUE, 0) -separator.show - -box2 = Gtk::VBox::new(FALSE, 10) -box2.border_width(10) -box1.pack_start(box2, FALSE, TRUE, 0) -box2.show - -button = Gtk::Button::new("close") -button.signal_connect("clicked") do - window.destroy - exit -end -box2.pack_start(button, TRUE, TRUE, 0) -button.set_flags(Gtk::CAN_DEFAULT); -button.grab_default -button.show - -window.show - -Gtk::main() |