ui/cocoa/container.m

changeset 811
1391ba7e533f
parent 800
814d374fb689
child 846
ffa983c223c1
equal deleted inserted replaced
810:7b5ba65b246f 811:1391ba7e533f
153 UiContainerX *ctn = ui_malloc(obj->ctx, sizeof(UiContainerX)); 153 UiContainerX *ctn = ui_malloc(obj->ctx, sizeof(UiContainerX));
154 ctn->container = (__bridge void*)container; 154 ctn->container = (__bridge void*)container;
155 ctn->close = 0; 155 ctn->close = 0;
156 ctn->prev = NULL; 156 ctn->prev = NULL;
157 ctn->next = NULL; 157 ctn->next = NULL;
158 container.container = ctn;
158 return ctn; 159 return ctn;
159 } 160 }
160 161
161 void ui_container_add(UiObject *obj, NSView *view, UiLayout *layout) { 162 void ui_container_add(UiObject *obj, NSView *view, UiLayout *layout) {
162 UiContainerX *ctn = obj->container_end; 163 UiContainerX *ctn = obj->container_end;
175 margin.bottom = layout->margin_bottom; 176 margin.bottom = layout->margin_bottom;
176 } 177 }
177 [container addView:view margin:margin]; 178 [container addView:view margin:margin];
178 } 179 }
179 180
180 /* ---------------------- public layout functions ----------------------- */
181
182 void ui_newline(UiObject *obj) {
183 UiContainerX *ctn = obj->container_end;
184 if(ctn) {
185 id<Container> container = (__bridge id<Container>)ctn->container;
186 container.newline = TRUE;
187 } else {
188 fprintf(stderr, "Error: obj has no container\n");
189 }
190 }

mercurial