ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 5日 (月) 10:55:36 JST
------------------------- REMOTE_ADDR = 184.145.95.170 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnui ------------------------- @@ -489,17 +489,17 @@ #!/usr/bin/env ruby require 'gtk2' menu = Gtk::Menu.new + radio_mi1 = Gtk::RadioMenuItem.new("_I want to be clicked!", true) radio_mi2 = Gtk::RadioMenuItem.new(radio_mi1, "_Click me instead!", true) radio_mi3 = Gtk::RadioMenuItem.new(radio_mi1, "No! Click _me!", true) radio_mi4 = Gtk::RadioMenuItem.new(radio_mi1, "_No! Click me instead!", true) radio_mi2.active = true - menu = Gtk::Menu.new menu.append(radio_mi1) menu.append(radio_mi2) menu.append(radio_mi3) menu.append(radio_mi4) - + ckbtt_mi1 = Gtk::CheckMenuItem.new("Check #1", true) ckbtt_mi2 = Gtk::CheckMenuItem.new("Check #2", true) # ckbtt_mi1.inconsistent = true # does not work as expected!? @@ -507,13 +507,13 @@ menu.append(Gtk::SeparatorMenuItem.new) menu.append(ckbtt_mi1) menu.append(ckbtt_mi2) - + imgbtt_mi1 = Gtk::ImageMenuItem.new(Gtk::Stock::CLEAR, accel_group = nil) imgbtt_mi2 = Gtk::ImageMenuItem.new(Gtk::Stock::HOME, accel_group = nil) menu.append(Gtk::SeparatorMenuItem.new) menu.append(imgbtt_mi1) menu.append(imgbtt_mi2) - + menu.show menu.show_all