ui/motif/label.c

branch
newapi
changeset 406
0ebf9d7b23e8
parent 176
bc63cb601f6d
equal deleted inserted replaced
405:a7f18dda6baf 406:0ebf9d7b23e8
32 #include "label.h" 32 #include "label.h"
33 #include "container.h" 33 #include "container.h"
34 #include "../common/context.h" 34 #include "../common/context.h"
35 #include "../common/object.h" 35 #include "../common/object.h"
36 36
37 UIWIDGET ui_label(UiObject *obj, char *label) {
38 UiContainer *ct = uic_get_current_container(obj);
39 XmString str = XmStringCreateLocalized(label);
40
41 int n = 0;
42 Arg args[16];
43 XtSetArg(args[n], XmNlabelString, str);
44 n++;
45
46 Widget parent = ct->prepare(ct, args, &n, FALSE);
47 Widget widget = XmCreateLabel(parent, "label", args, n);
48 ct->add(ct, widget);
49 XtManageChild(widget);
50
51 return widget;
52 }
53
54 UIWIDGET ui_space(UiObject *obj) {
55 UiContainer *ct = uic_get_current_container(obj);
56 XmString str = XmStringCreateLocalized("");
57
58 int n = 0;
59 Arg args[16];
60 XtSetArg(args[n], XmNlabelString, str);
61 n++;
62
63 Widget parent = ct->prepare(ct, args, &n, TRUE);
64 Widget widget = XmCreateLabel(parent, "space_label", args, n);
65 ct->add(ct, widget);
66 XtManageChild(widget);
67
68 return widget;
69 }

mercurial