comparison gtk/dw.c @ 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 9f87ad1572eb
children 5349a0735fda
comparison
equal deleted inserted replaced
204:098ed34d41fb 205:b9283fd56d69
828 else 828 else
829 msleep(milliseconds); 829 msleep(milliseconds);
830 } 830 }
831 831
832 /* 832 /*
833 * Processes a single message iteration and returns.
834 */
835 void dw_main_iteration(void)
836 {
837 _dw_thread = pthread_self();
838 _dw_thread_add(_dw_thread);
839 gdk_threads_enter();
840 gtk_main_iteration();
841 gdk_threads_leave();
842 }
843
844 /*
833 * Free's memory allocated by dynamic windows. 845 * Free's memory allocated by dynamic windows.
834 * Parameters: 846 * Parameters:
835 * ptr: Pointer to dynamic windows allocated 847 * ptr: Pointer to dynamic windows allocated
836 * memory to be free()'d. 848 * memory to be free()'d.
837 */ 849 */
3281 /* 3293 /*
3282 * Sets the scrollbar range. 3294 * Sets the scrollbar range.
3283 * Parameters: 3295 * Parameters:
3284 * handle: Handle to the scrollbar to be set. 3296 * handle: Handle to the scrollbar to be set.
3285 * range: Maximum range value. 3297 * range: Maximum range value.
3286 */ 3298 * visible: Visible area relative to the range.
3287 void API dw_scrollbar_set_range(HWND handle, unsigned int range) 3299 */
3300 void API dw_scrollbar_set_range(HWND handle, unsigned int range, unsigned int visible)
3288 { 3301 {
3289 int _locked_by_me = FALSE; 3302 int _locked_by_me = FALSE;
3290 GtkAdjustment *adjustment; 3303 GtkAdjustment *adjustment;
3291 3304
3292 if(!handle) 3305 if(!handle)
3293 return; 3306 return;
3294 3307
3295 DW_MUTEX_LOCK; 3308 DW_MUTEX_LOCK;
3296 adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "adjustment"); 3309 adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "adjustment");
3297 if(adjustment) 3310 if(adjustment)
3298 adjustment->upper = (gfloat)range; 3311 {
3312 adjustment->upper = (gdouble)range;
3313 adjustment->page_size = (gdouble)visible;
3314 }
3299 DW_MUTEX_UNLOCK; 3315 DW_MUTEX_UNLOCK;
3300 } 3316 }
3301 3317
3302 /* 3318 /*
3303 * Sets the spinbutton value. 3319 * Sets the spinbutton value.
7204 { 7220 {
7205 thisname = "focus-out-event"; 7221 thisname = "focus-out-event";
7206 if(GTK_IS_COMBO(thiswindow)) 7222 if(GTK_IS_COMBO(thiswindow))
7207 thiswindow = GTK_COMBO(thiswindow)->entry; 7223 thiswindow = GTK_COMBO(thiswindow)->entry;
7208 } 7224 }
7209 else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow)) 7225 else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) ||
7226 GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow))
7210 { 7227 {
7211 thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "adjustment"); 7228 thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "adjustment");
7212 } 7229 }
7213 7230
7214 if(!thisfunc || !thiswindow) 7231 if(!thisfunc || !thiswindow)