the_candyman
the_candyman

Reputation: 1663

Are GtkSpinButton capable to set a time interval?

I would like to insert in my program a spin button to change a time interval. In particular, it should visualize a time in the format hh:mm:ss and the spin button should increase/decrease of one second the time inverval.

How can I achieve this?

Upvotes: 2

Views: 282

Answers (1)

Simon Feltman
Simon Feltman

Reputation: 1126

Use the "output" signal of GtkSpinButton [1]. This allows a hook for setting the underlying GtkEntry text when the value changes. The docs already provide a good example so I will leave that out of my answer. Similarly if you accept user input in the same format, the "input" signal can be used to parse the custom formatting back into a double.

  1. https://developer.gnome.org/gtk3/stable/GtkSpinButton.html#GtkSpinButton-output

Upvotes: 3

Related Questions