I think all you need to do is create a HandleBox and then stuff your ToolBar into that.
Here is a python example:
Code:
#!/usr/bin/env python
import gtk
class MainWindow(gtk.Window):
def __init__(self):
super(MainWindow, self).__init__()
vbox = gtk.VBox()
handlebox = gtk.HandleBox()
self.add(vbox)
vbox.pack_start(handlebox, False, False, 4)
toolbar = gtk.Toolbar()
toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
toolbar.set_border_width(4)
# just add some useless buttons to our toolbar
toolbar.add(gtk.ToolButton(gtk.STOCK_NEW))
toolbar.add(gtk.ToolButton(gtk.STOCK_OPEN))
toolbar.add(gtk.ToolButton(gtk.STOCK_SAVE))
toolbar.add(gtk.ToolButton(gtk.STOCK_QUIT))
# I found if you dont set a minimum width for the toolbar
# when you detach it, it will shrink to just a menu basically
toolbar.set_size_request(300, 36)
# the trick is just to put our toolbar inside the handlebox
handlebox.add(toolbar)
vbox.show_all()
self.set_size_request(300, 200)
if __name__ == "__main__":
w = MainWindow()
w.show()
gtk.main()
Bookmarks