ruby-****@sourc*****
ruby-****@sourc*****
2009年 3月 4日 (水) 07:19:48 JST
------------------------- REMOTE_ADDR = 74.15.84.244 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dynui-bui ------------------------- @@ -125,3 +125,10 @@ Glade is a perfect opportunity for you to experiment with packing options to gain better understanding of how they affect the widget. The packing tab also includes options to determine padding around the widget, whether the packing is from the start or from the end of the box, and to determine the widget's position within the container. These properties are exactly the same as those you use when adding children widgets to the Gtk::Box with Gtk::Box#pack_start and related instance methods. + +=== Completing the File Browser + +{{image_left("glade-fig-10-09-toolbeditor-addrbar-1.png")}} +{{br}} + +The next step in creating our file browser is to create the address bar that will show the users the current location and allow them to enter a new location. This means that we need (1) a horizontal box with three cells, (1.a) first for a label describing the content held in the (1.b) second cell in Gtk::Entry widget, and (1.c) the last cell holding the button that will move to the location when pressed. You should have no trouble placing these items { (1), (1.a), (1.b) and (1.c) } into the second cell underneath the toolbar we just created in the vertical box. For our fourth item (1.c), we could easily just use the Gtk::Stock::JUMP stock item, but instead we will learn how to turn a button into a container. In order to do that you first need to change the button type to a container in the Properties dialogue. This will display an empty container mesh as the content of the button. Next we will add a horizontal box with two cells one for the image (Gtk::Stock::JUMP_TO) and the other for the label "Go". Yet another interesting thing to note is the use of Pango Text Markup with our label. To activate markup feature you need to set it in the Properties for the label widget.