gtk4-demo: Fix the scrollbar popup menu example

A scrollbar is not a range anymore, so the callback
needs some adjustments (!).
This commit is contained in:
Matthias Clasen 2017-10-07 19:54:47 -04:00
parent 7e64ee52a8
commit e1338e4e12

View File

@ -958,7 +958,7 @@ start_cb (GtkMenuItem *item, GtkWidget *scrollbar)
{ {
GtkAdjustment *adj; GtkAdjustment *adj;
adj = gtk_range_get_adjustment (GTK_RANGE (scrollbar)); adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj)); gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
} }
@ -967,7 +967,7 @@ end_cb (GtkMenuItem *item, GtkWidget *scrollbar)
{ {
GtkAdjustment *adj; GtkAdjustment *adj;
adj = gtk_range_get_adjustment (GTK_RANGE (scrollbar)); adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj)); gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
} }