Gtk.CellRendererSpin
const Gtk = imports.gi.Gtk; let cell_renderer_spin = new Gtk.CellRendererSpin({ adjustment: value, climb_rate: value, digits: value, });
Gtk.CellRendererSpin renders text in a cell like Gtk.CellRendererText from which it is derived. But while Gtk.CellRendererText offers a simple entry to edit the text, Gtk.CellRendererSpin offers a Gtk.SpinButton widget. Of course, that means that the text has to be parseable as a floating point number.
The range of the spinbutton is taken from the adjustment property of the cell renderer, which can be set explicitly or mapped to a column in the tree model, like all properties of cell renders. Gtk.CellRendererSpin also has properties for the Gtk.climb-rate and the number of Gtk.digits to display. Other Gtk.SpinButton properties can be set in a handler for the Gtk.CellRenderer::editing-started signal.
The Gtk.CellRendererSpin cell renderer was added in GTK+ 2.10.
Hierarchy
-
GObject.Object
-
GObject.InitiallyUnowned
-
Gtk.CellRenderer
-
Gtk.CellRendererText
- Gtk.CellRendererSpin
-
-
-