static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct editor *editor = data; text_entry_allocate(editor->entry, 20, 20, width - 40, height / 2 - 40); text_entry_allocate(editor->editor, 20, height / 2 + 20, width - 40, height / 2 - 40); }
static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct editor *editor = data; struct rectangle allocation; widget_get_allocation(editor->widget, &allocation); text_entry_allocate(editor->entry, allocation.x + 20, allocation.y + 20, width - 40, height / 2 - 40); text_entry_allocate(editor->editor, allocation.x + 20, allocation.y + height / 2 + 20, width - 40, height / 2 - 40); }