changeset 205:b9283fd56d69

Updated scrollbar code on Unix and added dw_main_iteration()
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 01 Feb 2003 08:12:56 +0000
parents 098ed34d41fb
children f7911991c5df
files gtk/dw.c
diffstat 1 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sat Feb 01 08:00:38 2003 +0000
+++ b/gtk/dw.c	Sat Feb 01 08:12:56 2003 +0000
@@ -830,6 +830,18 @@
 }
 
 /*
+ * Processes a single message iteration and returns.
+ */
+void dw_main_iteration(void)
+{
+	_dw_thread = pthread_self();
+	_dw_thread_add(_dw_thread);
+	gdk_threads_enter();
+	gtk_main_iteration();
+	gdk_threads_leave();
+}
+
+/*
  * Free's memory allocated by dynamic windows.
  * Parameters:
  *           ptr: Pointer to dynamic windows allocated
@@ -3283,8 +3295,9 @@
  * Parameters:
  *          handle: Handle to the scrollbar to be set.
  *          range: Maximum range value.
- */
-void API dw_scrollbar_set_range(HWND handle, unsigned int range)
+ *          visible: Visible area relative to the range.
+ */
+void API dw_scrollbar_set_range(HWND handle, unsigned int range, unsigned int visible)
 {
 	int _locked_by_me = FALSE;
 	GtkAdjustment *adjustment;
@@ -3295,7 +3308,10 @@
 	DW_MUTEX_LOCK;
 	adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "adjustment");
 	if(adjustment)
-		adjustment->upper = (gfloat)range;
+	{
+		adjustment->upper = (gdouble)range;
+		adjustment->page_size = (gdouble)visible;
+	}
 	DW_MUTEX_UNLOCK;
 }
 
@@ -7206,7 +7222,8 @@
 		if(GTK_IS_COMBO(thiswindow))
 			thiswindow = GTK_COMBO(thiswindow)->entry;
 	}
-	else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow))
+	else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) ||
+			GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow))
 	{
 		thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "adjustment");
 	}