# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1043061387 0 # Node ID 11b5da6196c2bf88587d24e511b67b66bb98e2e0 # Parent f3718165f0b2dd61016224a7d4d8c085b0a611de Implemented dw_scrollbar_set_range() on Unix and fixed a bug in the test app. diff -r f3718165f0b2 -r 11b5da6196c2 dwtest.c --- a/dwtest.c Mon Jan 20 11:08:43 2003 +0000 +++ b/dwtest.c Mon Jan 20 11:16:27 2003 +0000 @@ -167,7 +167,7 @@ scrollbar = dw_scrollbar_new(FALSE, 100, 0); dw_box_pack_start( pagebox, scrollbar, 100, 20, TRUE, FALSE, 0); - dw_scrollbar_set_range(scrollbar, 0, 0); + dw_scrollbar_set_range(scrollbar, 0); text1pm = dw_pixmap_new( textbox1, font_width*width1, font_height*rows, depth ); text2pm = dw_pixmap_new( textbox2, font_width*width2, font_height*rows, depth ); diff -r f3718165f0b2 -r 11b5da6196c2 gtk/dw.c --- a/gtk/dw.c Mon Jan 20 11:08:43 2003 +0000 +++ b/gtk/dw.c Mon Jan 20 11:16:27 2003 +0000 @@ -3279,6 +3279,27 @@ } /* + * Sets the scrollbar range. + * Parameters: + * handle: Handle to the scrollbar to be set. + * range: Maximum range value. + */ +void API dw_scrollbar_set_range(HWND handle, unsigned int range) +{ + int _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "adjustment"); + if(adjustment) + adjustment->upper = (gfloat)range; + DW_MUTEX_UNLOCK; +} + +/* * Sets the spinbutton value. * Parameters: * handle: Handle to the spinbutton to be set.