comparison gtk3/dw.c @ 1127:ed7cbdc37a75

Widget GTK3 v/halign properties get set according to the sizing flags during widget packing. This makes alignment the same as on other platforms.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 30 Aug 2011 07:53:05 +0000
parents 72a36ef67291
children 1a5b0908659b
comparison
equal deleted inserted replaced
1126:72a36ef67291 1127:ed7cbdc37a75
8009 fclose( dbgfp ); 8009 fclose( dbgfp );
8010 } 8010 }
8011 exit(exitcode); 8011 exit(exitcode);
8012 } 8012 }
8013 8013
8014 #define DW_EXPAND (GTK_EXPAND | GTK_SHRINK | GTK_FILL)
8015
8016 /* Internal box packing function called by the other 3 functions */ 8014 /* Internal box packing function called by the other 3 functions */
8017 void _dw_box_pack(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad, char *funcname) 8015 void _dw_box_pack(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad, char *funcname)
8018 { 8016 {
8019 int warn = FALSE, _locked_by_me = FALSE; 8017 int warn = FALSE, _locked_by_me = FALSE;
8020 GtkWidget *tmp, *tmpitem, *image = NULL; 8018 GtkWidget *tmp, *tmpitem, *image = NULL;
8101 index = boxcount; 8099 index = boxcount;
8102 8100
8103 g_object_set_data(G_OBJECT(item), "_dw_table", box); 8101 g_object_set_data(G_OBJECT(item), "_dw_table", box);
8104 /* Set the expand attribute on the widgets now instead of the container */ 8102 /* Set the expand attribute on the widgets now instead of the container */
8105 gtk_widget_set_vexpand(item, vsize); 8103 gtk_widget_set_vexpand(item, vsize);
8104 gtk_widget_set_valign(item, vsize ? GTK_ALIGN_FILL : GTK_ALIGN_START);
8106 gtk_widget_set_hexpand(item, hsize); 8105 gtk_widget_set_hexpand(item, hsize);
8106 gtk_widget_set_halign(item, hsize ? GTK_ALIGN_FILL : GTK_ALIGN_START);
8107 /* Use the margin property as padding */ 8107 /* Use the margin property as padding */
8108 g_object_set(G_OBJECT(item), "margin", pad, NULL); 8108 g_object_set(G_OBJECT(item), "margin", pad, NULL);
8109 /* Add to the grid using insert... 8109 /* Add to the grid using insert...
8110 * rows for vertical boxes and columns for horizontal. 8110 * rows for vertical boxes and columns for horizontal.
8111 */ 8111 */