| 40 UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) { |
40 UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) { |
| 41 Arg xargs[64]; |
41 Arg xargs[64]; |
| 42 int n = 0; |
42 int n = 0; |
| 43 |
43 |
| 44 UiContainerPrivate *ctn = ui_obj_container(obj); |
44 UiContainerPrivate *ctn = ui_obj_container(obj); |
| 45 UI_APPLY_LAYOUT(ctn->layout, args); |
45 UiLayout layout = UI_ARGS2LAYOUT(args); |
| 46 |
46 |
| 47 Widget parent = ctn->prepare(ctn, xargs, &n); |
47 Widget parent = ui_container_prepare(ctn, &layout, xargs, &n); |
| 48 Widget widget = create_widget(obj, args, userdata, parent, xargs, n); |
48 Widget widget = create_widget(obj, args, userdata, parent, xargs, n); |
| 49 XtManageChild(widget); |
49 XtManageChild(widget); |
| 50 ctn->add(ctn, widget); |
50 ui_container_add(ctn, widget); |
| 51 |
51 |
| 52 return widget; |
52 return widget; |
| 53 } |
53 } |
| 54 |
54 |
| 55 |
55 |
| 56 UIEXPORT UIWIDGET ui_separator_create(UiObject *obj, UiWidgetArgs *args) { |
56 UIEXPORT UIWIDGET ui_separator_create(UiObject *obj, UiWidgetArgs *args) { |
| 57 Arg xargs[64]; |
57 Arg xargs[64]; |
| 58 int n = 0; |
58 int n = 0; |
| 59 |
59 |
| 60 UiContainerPrivate *ctn = ui_obj_container(obj); |
60 UiContainerPrivate *ctn = ui_obj_container(obj); |
| 61 UI_APPLY_LAYOUT(ctn->layout, args); |
61 UiLayout layout = UI_ARGS2LAYOUT(args); |
| 62 |
62 |
| 63 char *name = args->name ? (char*)args->name : "separator"; |
63 char *name = args->name ? (char*)args->name : "separator"; |
| 64 Widget parent = ctn->prepare(ctn, xargs, &n); |
64 Widget parent = ui_container_prepare(ctn, &layout, xargs, &n); |
| 65 Widget widget = XmCreateSeparator(parent, name, xargs, n); |
65 Widget widget = XmCreateSeparator(parent, name, xargs, n); |
| 66 XtManageChild(widget); |
66 XtManageChild(widget); |
| 67 ctn->add(ctn, widget); |
67 ui_container_add(ctn, widget); |
| 68 |
68 |
| 69 return widget; |
69 return widget; |
| 70 } |
70 } |
| 71 |
71 |
| 72 void ui_widget_set_size(UIWIDGET w, int width, int height) { |
72 void ui_widget_set_size(UIWIDGET w, int width, int height) { |