14 Oct

Creating a Toolbar in GTK Python(PyGTK)

Creating a toolbar using GTK Python. There is an old method – but this example shows a better method of creating a toolbar using pygtk.


toolbar = gtk.Toolbar()
toolbar.set_style(gtk.TOOLBAR_BOTH)

toolbar_item = gtk.ToolButton("Quit")
toolbar_item.set_stock_id(gtk.STOCK_QUIT)
toolbar_item.connect("clicked", exit)
toolbar_item.show()
toolbar.insert(toolbar_item, -1)

toolbar.show()