| 584 |
584 |
| 585 void ui_tabview_container_add(UiContainerPrivate *ctn, Widget widget) { |
585 void ui_tabview_container_add(UiContainerPrivate *ctn, Widget widget) { |
| 586 ui_reset_layout(ctn->layout); |
586 ui_reset_layout(ctn->layout); |
| 587 } |
587 } |
| 588 |
588 |
| 589 |
589 /* -------------------- ScrolledWindow -------------------- */ |
| |
590 |
| |
591 Widget ui_scrolledwindow_prepare(UiContainerPrivate *ctn, Arg *args, int *n) { |
| |
592 return ctn->widget; |
| |
593 } |
| |
594 |
| |
595 void ui_scrolledwindow_add(UiContainerPrivate *ctn, Widget widget) { |
| |
596 |
| |
597 } |
| |
598 |
| |
599 static UiContainerX* ui_scrolledwindow_container(UiObject *obj, Widget scrolledwindow) { |
| |
600 UiContainerPrivate *ctn = ui_malloc(obj->ctx, sizeof(UiContainerPrivate)); |
| |
601 memset(ctn, 0, sizeof(UiContainerPrivate)); |
| |
602 ctn->prepare = ui_scrolledwindow_prepare; |
| |
603 ctn->add = ui_scrolledwindow_add; |
| |
604 ctn->widget = scrolledwindow; |
| |
605 return (UiContainerX*)ctn; |
| |
606 } |
| |
607 |
| |
608 UIWIDGET ui_scrolledwindow_create(UiObject* obj, UiFrameArgs args) { |
| |
609 UiContainerPrivate *ctn = ui_obj_container(obj); |
| |
610 UI_APPLY_LAYOUT(ctn->layout, args); |
| |
611 |
| |
612 Arg xargs[16]; |
| |
613 int n = 0; |
| |
614 |
| |
615 XtSetArg(xargs[n], XmNscrollingPolicy, XmAUTOMATIC); n++; |
| |
616 |
| |
617 Widget parent = ctn->prepare(ctn, xargs, &n); |
| |
618 Widget scrolledwindow = XmCreateScrolledWindow(parent, "scrolledwindow", xargs, n); |
| |
619 ctn->add(ctn, scrolledwindow); |
| |
620 |
| |
621 UiContainerX *container = ui_scrolledwindow_container(obj, scrolledwindow); |
| |
622 uic_object_push_container(obj, container); |
| |
623 |
| |
624 return scrolledwindow; |
| |
625 } |
| 590 |
626 |
| 591 /* -------------------- Container Helper Functions -------------------- */ |
627 /* -------------------- Container Helper Functions -------------------- */ |
| 592 |
628 |
| 593 void ui_container_begin_close(UiObject *obj) { |
629 void ui_container_begin_close(UiObject *obj) { |
| 594 UiContainerPrivate *ct = ui_obj_container(obj); |
630 UiContainerPrivate *ct = ui_obj_container(obj); |