Gtk_spin_button_set_text() and GTK4

I have already asked him for some more details,

https://github.com/StefanSalewski/gintro/issues/191

but I think I should ask here any way. Have done already a 10 minutes Google research, but Google works very bad for me currently.

So what is the actual state in latest GTK4 for custom text formatting of GtkSpinButton?

You can use the GtkSpinButton::input signal to transform the contents of the spin button into a floating point value that can be mapped onto the adjustment; and the GtkSpinButton::output signal to transform a floating point value coming from the adjustment into the contents of the spin button’s text area.

1 Like

Your second link points me to a page which Google already gave me:

Gtk.SpinButton::output

I had the feeling that that one is an outdated page. The example used
gtk_spin_button_set_text() which seems to be not available in recent GTK4 API docs or on my local Linux computer. And not in the recent GTK4 GIR file.

The example code is likely out of date; GtkSpinButton implements the GtkEditable interface, so calling gtk_editable_set_text() will replace gtk_spin_button_set_text().

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.