How do I place a SpinButton widget on a Toolbar using GTK, or GTKmm?
1 Answer
A gtkToolbar accept any gktWidget, like any other container. An example in python:
import gtk
root = gtk.Window()
toolbar = gtk.Toolbar()
root.add(toolbar)
spinbutton = gtk.SpinButton()
toolbar.add(spinbutton)
root.show_all()
gtk.main()
So this works just like adding the GtkToolbar to the GtkWindow.
-
Oh, sure, it inherits from gtk.Container. Thanks for quick tip! Jan 6, 2011 at 17:01
-
-
I think it's not possible, but I don't know - I always use GtkBuilder and Glade instead. Jan 6, 2011 at 17:15
-
Whoops. That does not work. It does compile, but running the application results with an error message in the stdio, stating that this is ToolBar's deprecated API. Jan 7, 2011 at 20:36
-
Oh, got it to work. Had to add a ToolItem into the tooblar, then call toolitem.add(spinbutton). Jan 8, 2011 at 20:47