comparison gtk3/dw.c @ 1429:fbaec6e5df63

Added dw_window_get_preferred_size() which attempts to determine the size the system wants for the widget. This is useful when creating nice looking layouts.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 04 Dec 2011 20:11:38 +0000
parents dfd9f177c34c
children 95ca625b8ffc
comparison
equal deleted inserted replaced
1428:7826031d48ce 1429:fbaec6e5df63
8556 gtk_widget_set_size_request(handle, width, height); 8556 gtk_widget_set_size_request(handle, width, height);
8557 DW_MUTEX_UNLOCK; 8557 DW_MUTEX_UNLOCK;
8558 } 8558 }
8559 8559
8560 /* 8560 /*
8561 * Gets the size the system thinks the widget should be.
8562 * Parameters:
8563 * handle: Window handle of the item to be back.
8564 * width: Width in pixels of the item or NULL if not needed.
8565 * height: Height in pixels of the item or NULL if not needed.
8566 */
8567 void API dw_window_get_preferred_size(HWND handle, int *width, int *height)
8568 {
8569 int _locked_by_me = FALSE;
8570
8571 DW_MUTEX_LOCK;
8572 if(width)
8573 gtk_widget_get_preferred_width(handle, NULL, width);
8574 if(height)
8575 gtk_widget_get_preferred_height(handle, NULL, height);
8576 DW_MUTEX_UNLOCK;
8577 }
8578
8579 /*
8561 * Returns the width of the screen. 8580 * Returns the width of the screen.
8562 */ 8581 */
8563 int dw_screen_width(void) 8582 int dw_screen_width(void)
8564 { 8583 {
8565 int retval; 8584 int retval;