After being googling for 2 weeks, I decided it was time to post my trouble.
Using Gtk2.24 for windows and relatively new programming with Gtk.
I create it with:
hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.1, 1, 1)));
And connect signals:
g_signal_connect ((gpointer) hscale, "value_changed",
g_signal_connect ((gpointer) hscale, "button_release_event",
g_signal_connect( (gpointer) hscale, "change-value",
G_CALLBACK( on_hscale_change_value ), NULL );
I'm trying to reset the position of a gtkhscale to its initial point after the user release the slider.
I connect on_hscale_button_release_event and set the value of the range gtk_range_set_value ( widget, 0.00); but the slider doesnt move back and the value is not set to 0.00. Why?
If I use gtk_range_set_fill_level the slider does move back but after that doesnt receive any other user input, i can not move the slider with the mouse or keyboard.
In a post found a suggestion and tried:
GtkAdjustment *a = (GtkAdjustment *)gtk_adjustment_new(0, 0, 100, 0.1, 1, 1);
gtk_range_set_adjustment(GTK_RANGE( widget ), a);
The slider doesnt moved back.
I've tried to connect and disconnect signals, but nothing seems to move the slider back to its initial position.
How can I "moved back" the slider when the button_release_event is fired?