Hi, I tried to make an interface like this.
http://i.imgur.com/hwfq1n6.png
But my interface:
http://i.imgur.com/F6OQ1nX.png
I want to adjoin toolbar and gtk.entry line. How can I do this? And
source code:
win = Gtk::Window.new
swin = Gtk::ScrolledWindow.new
swin_vpaned = Gtk::Paned.new(:horizontal)
viewport = Gtk::Viewport.new(swin.hadjustment, swin.vadjustment)
@file_store = Gtk::ListStore.new(String, String, TrueClass,
Gdk::Pixbuf)
main_vbox = Gtk::Box.new(:vertical, 2)
toolbar_hbox = Gtk::Box.new(:horizontal, 0)
menus = create_menubar
create_toolbar()
toolbar_hbox.pack_start(@toolbar, :expand => false, :fill => true,
:padding =>0)
toolbar_hbox.pack_start(@file_path_entry, :expand => true, :fill =>
true, :padding => 0)
main_vbox.pack_start(menus, :expand => false, :fill => false,
:padding => 2)
main_vbox.pack_start(toolbar_hbox, :expand => true, :fill => true,
:padding => 2)
main_vbox.pack_start(swin_vpaned, :expand => true, :fill => true,
:padding => 1)
treeview_vbox = Gtk::Box.new(:vertical, 1)
# devices treeview
dev_treeview = create_devices_treeview
treeview_vbox.pack_start(dev_treeview, :expand => false, :fill =>
false, :padding => 2)
create_places_treeview
treeview_vbox.pack_start(@places_treeview)
swin_vpaned.pack1(treeview_vbox, :resize => true, :shrink => false)
swin_vpaned.pack2(swin, :resize => true, :shrink => false)
win = Gtk::Window.new
swin = Gtk::ScrolledWindow.new
swin_vpaned = Gtk::Paned.new(:horizontal)
viewport = Gtk::Viewport.new(swin.hadjustment, swin.vadjustment)
@file_store = Gtk::ListStore.new(String, String, TrueClass,
Gdk::Pixbuf)
main_vbox = Gtk::Box.new(:vertical, 2)
toolbar_hbox = Gtk::Box.new(:horizontal, 0)
menus = create_menubar
create_toolbar()
toolbar_hbox.pack_start(@toolbar, :expand => false, :fill => true,
:padding =>0)
toolbar_hbox.pack_start(@file_path_entry, :expand => true, :fill =>
true, :padding => 0)
main_vbox.pack_start(menus, :expand => false, :fill => false,
:padding => 2)
main_vbox.pack_start(toolbar_hbox, :expand => true, :fill => true,
:padding => 2)
main_vbox.pack_start(swin_vpaned, :expand => true, :fill => true,
:padding => 1)
treeview_vbox = Gtk::Box.new(:vertical, 1)
# devices treeview
dev_treeview = create_devices_treeview
treeview_vbox.pack_start(dev_treeview, :expand => false, :fill =>
false, :padding => 2)
create_places_treeview
treeview_vbox.pack_start(@places_treeview)
swin_vpaned.pack1(treeview_vbox, :resize => true, :shrink => false)
swin_vpaned.pack2(swin, :resize => true, :shrink => false)
def create_toolbar
@toolbar = Gtk::Toolbar.new
@toolbar.set_size_request(30,30)
tool buttons
@back_toolbut = Gtk::ToolButton.new(:stock_id => Gtk::Stock::GO_BACK)
@next_toolbut = Gtk::ToolButton.new(:stock_id =>
Gtk::Stock::GO_FORWARD)
home_toolbut = Gtk::ToolButton.new(:stock_id => Gtk::Stock::HOME)
up_toolbut = Gtk::ToolButton.new(:stock_id => Gtk::Stock::GO_UP)
@back_toolbut.sensitive = false
@next_toolbut.sensitive = false
@back_toolbut.signal_connect(“clicked”){fill_store(“back”)}
@next_toolbut.signal_connect(“clicked”){fill_store(“next”)}
@toolbar.insert(@back_toolbut, 0)
@toolbar.insert(@next_toolbut, 1)
@toolbar.insert(up_toolbut, 2)
@toolbar.insert(home_toolbut, 3)
@toolbar.set_size_request(5, 5)
end
Thanks.