ui/gtk/container.c

changeset 94
d51e334c1439
parent 75
efe2f65bea17
child 99
ea1a2d5de765
equal deleted inserted replaced
93:5223de7979e2 94:d51e334c1439
121 grid->x = 0; 121 grid->x = 0;
122 grid->y++; 122 grid->y++;
123 ct->layout.newline = FALSE; 123 ct->layout.newline = FALSE;
124 } 124 }
125 125
126 if(ct->layout.fill != UI_LAYOUT_UNDEFINED) {
127 fill = ui_lb2bool(ct->layout.fill);
128 }
129 if(fill) {
130 gtk_widget_set_hexpand(widget, TRUE);
131 }
132
126 gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, 1, 1); 133 gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, 1, 1);
127 grid->x++; 134 grid->x++;
128 135
129 ui_reset_layout(ct->layout); 136 ui_reset_layout(ct->layout);
130 ct->current = widget; 137 ct->current = widget;
200 207
201 return hbox; 208 return hbox;
202 } 209 }
203 210
204 UIWIDGET ui_grid(UiObject *obj) { 211 UIWIDGET ui_grid(UiObject *obj) {
212 return ui_grid_sp(obj, 0, 0);
213 }
214
215 UIWIDGET ui_grid_sp(UiObject *obj, int columnspacing, int rowspacing) {
205 UiContainer *ct = uic_get_current_container(obj); 216 UiContainer *ct = uic_get_current_container(obj);
206 217
207 #ifdef UI_GTK3 218 #ifdef UI_GTK3
208 GtkWidget *grid = gtk_grid_new(); 219 GtkWidget *grid = gtk_grid_new();
220 gtk_grid_set_column_spacing(GTK_GRID(grid), columnspacing);
221 gtk_grid_set_row_spacing(GTK_GRID(grid), rowspacing);
222
209 #elif defined(UI_GTK2) 223 #elif defined(UI_GTK2)
210 GtkWidget *grid = gtk_table_new(1, 1, FALSE); 224 GtkWidget *grid = gtk_table_new(1, 1, FALSE);
211 #endif 225 #endif
212 ct->add(ct, grid, TRUE); 226 ct->add(ct, grid, TRUE);
213 227

mercurial