ruby-****@lists*****
ruby-****@lists*****
2003年 5月 11日 (日) 21:11:11 JST
------------------------- REMOTE_ADDR = 61.26.70.211 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/?%C9%E1%C4%CC%A4%CE%A5%DC%A5%BF%A5%F3 ------------------------- ------------------------- = 普通のボタン {{image_right "button.png"}} #! /usr/bin/env ruby require 'gtk2' def xpm_label_box(xpm_filename, label_text) box = Gtk::HBox.new(false, 0) box.border_width = 2 image = Gtk::Image.new(xpm_filename) label = Gtk::Label.new(label_text) box.pack_start(image, false, false, 3) box.pack_start(label, false, false, 3) box end Gtk::init window = Gtk::Window.new(Gtk::Window::TOPLEVEL) window.title = "Pixmap'd Buttons!" window.border_width = 10 window.signal_connect("destroy") {Gtk::main_quit} window.signal_connect("delete_event") {Gtk::main_quit} button = Gtk::Button.new button.signal_connect("clicked") do puts "Hello again - cool button was pressed" end box = xpm_label_box("xpm/folder.xpm", "cool button") button.add(box) window.add(button) window.show_all Gtk::main