1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <stdio.h>
30 #include <stdlib.h>
31
32 #include "label.h"
33 #include "container.h"
34 #include "../common/context.h"
35 #include "../common/object.h"
36 #include <ucx/mempool.h>
37
38 UIWIDGET ui_label(UiObject *obj,
char *label) {
39 UiContainer *ct = uic_get_current_container(obj);
40 XmString str = XmStringCreateLocalized(label);
41
42 int n =
0;
43 Arg args[
16];
44 XtSetArg(args[n], XmNlabelString, str);
45 n++;
46
47 Widget parent = ct->prepare(ct, args, &n,
FALSE);
48 Widget widget = XmCreateLabel(parent,
"label", args, n);
49 ct->add(ct, widget);
50 XtManageChild(widget);
51
52 return widget;
53 }
54
55 UIWIDGET ui_space(UiObject *obj) {
56 UiContainer *ct = uic_get_current_container(obj);
57 XmString str = XmStringCreateLocalized(
"");
58
59 int n =
0;
60 Arg args[
16];
61 XtSetArg(args[n], XmNlabelString, str);
62 n++;
63
64 Widget parent = ct->prepare(ct, args, &n,
TRUE);
65 Widget widget = XmCreateLabel(parent,
"space_label", args, n);
66 ct->add(ct, widget);
67 XtManageChild(widget);
68
69 return widget;
70 }
71