In a ColumnViewColumn
bind
callback:
LIMITS = {
U8Event: (0, 255),
I8Event: (-128, 127),
U16Event: (0, 65535),
I16Event: (-32768, 32767),
U32Event: (0, 4294967295),
I32Event: (-2147483648, 2147483647),
F32Event: (3.4e-38, 3.4e38),
}
...
elif isinstance(value, (int, float)):
widget = Gtk.SpinButton(value=value, css_classes=["compact"])
for type_, limits in LIMITS.items():
if isinstance(event, type_):
widget.props.adjustment = Gtk.Adjustment(lower=limits[0], upper=limits[1])
...
When my ColumnView
gets populated, all the SpinButton
s are set to 0
and the + / - buttons don’t work either. Interestingly, this doesn’t happen if I use a different widget like Text
or Entry
.