ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 21日 (水) 05:39:46 JST
------------------------- REMOTE_ADDR = 184.145.95.170 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-tb ------------------------- @@ -497,4 +497,52 @@ window.show_all Gtk.main + + + {{br}} +#### === Some 'detaching-toolbar-w-HandleBox.rb' Program Notes + + + + +=== Orientation Of Detached Toolbar + + # Create handle box wrapper + # ----------------------------------------------------------------------- + handle = Gtk::HandleBox.new + + # Add a shadow to the handle box, set the handle position + # on the left and set the snap edge to the top of the widget. + handle.shadow_type = Gtk::SHADOW_IN + handle.handle_position = Gtk::POS_TOP # or ... Gtk::POS_LEFT + handle.snap_edge = Gtk::POS_TOP # or ... Gtk::POS_LEFT + + =begin + # ---- handle's signal handlers are optional ----- (start) -- + handle.signal_connect('child-detached') do |w, child| + puts "dettached: child=#{child.class}" + child.set_size_request(80, 450) + child.orientation = Gtk::Orientation::VERTICAL + end + handle.signal_connect('child-attached') do |w, child| + child.set_size_request(400, -1) + child.orientation = Gtk::Orientation::HORIZONTAL + puts "attached: child=#{child.class}" + end + # ---- handle's signal handlers are optional ----- (end) -- + =end + + toolbar.set_size_request(300, -1) # -- Important, otherwise only arrow + # item box would be moved out! + + handle.add(toolbar) + # ----------------------------------------------------------------------- + + + + + +{{br}} + +=== Dragging a Toolbar Within a Window