ruby-****@sourc*****
ruby-****@sourc*****
2009年 3月 4日 (水) 07:57:35 JST
------------------------- REMOTE_ADDR = 74.15.84.244 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dynui-bui ------------------------- @@ -132,3 +132,11 @@ {{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 (1.b) the 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. + + +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 (1.b) the 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. You may also activate mnemonics by setting the property "Use underline" just underneath the "Use markup" property. + +The remaining step here is to add a Gtk::ScrolledWindow widget to the last (third) cell in the vertical box and the Gtk::TreeView to that container. On the following figure you can see the result of our work so far: + +{{image_left("glade-fig-10-11-toolbeditor-browser-1.png")}} +{{br}}