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 "container.h"
33 #include "../common/object.h"
34
35 UIWIDGET ui_vbox(UiObject *obj) {
36 return ui_vbox_sp(obj,
0,
0);
37 }
38
39 UIWIDGET ui_hbox(UiObject *obj) {
40 return ui_hbox_sp(obj,
0,
0);
41 }
42
43 UIWIDGET ui_vbox_sp(UiObject *obj,
int margin,
int spacing) {
44 UiContainer *ct = uic_get_current_container(obj);
45
46 UIWIDGET vbox = UIvbox(ct, margin, spacing);
47
48 UiObject *newobj = uic_object_new(obj, vbox);
49 newobj->container = (UiContainer*)vbox;
50 uic_obj_add(obj, newobj);
51
52 return vbox;
53 }
54
55 UIWIDGET ui_hbox_sp(UiObject *obj,
int margin,
int spacing) {
56 UiContainer *ct = uic_get_current_container(obj);
57
58 UIWIDGET hbox = UIhbox(ct, margin, spacing);
59
60 UiObject *newobj = uic_object_new(obj, hbox);
61 newobj->container = (UiContainer*)hbox;
62 uic_obj_add(obj, newobj);
63
64 return hbox;
65 }
66
67 UIWIDGET ui_grid(UiObject *obj) {
68 return ui_grid_sp(obj,
0,
0,
0);
69 }
70
71 UIWIDGET ui_grid_sp(UiObject *obj,
int margin,
int columnspacing,
int rowspacing) {
72 UiContainer *ct = uic_get_current_container(obj);
73
74 UIWIDGET grid = UIgrid(ct, margin, columnspacing, rowspacing);
75
76 UiObject *newobj = uic_object_new(obj, grid);
77 newobj->container = (UiContainer*)grid;
78 uic_obj_add(obj, newobj);
79
80 return grid;
81 }
82
83 UIWIDGET ui_scrolledwindow(UiObject *obj) {
84 UiContainer *ct = uic_get_current_container(obj);
85
86 UIWIDGET scrolledwindow = UIscrolledwindow(ct);
87
88 UiObject *newobj = uic_object_new(obj, scrolledwindow);
89 newobj->container = (UiContainer*)scrolledwindow;
90 uic_obj_add(obj, newobj);
91
92 return scrolledwindow;
93 }
94
95
96
97
98
99 UIWIDGET ui_tabview(UiObject *obj) {
100 UiContainer *ct = uic_get_current_container(obj);
101
102 UIWIDGET tabview = UItabview(ct);
103
104 UiObject *newobj = uic_object_new(obj, tabview);
105 newobj->container = (UiContainer*)tabview;
106 uic_obj_add(obj, newobj);
107
108 return tabview;
109 }
110
111 void ui_tab(UiObject *obj,
char *title) {
112 UiContainer *ct = uic_get_current_container(obj);
113 UItab(ct, title);
114 }
115
116
117
118
119
120
121
122
123
124 void ui_layout_fill(UiObject *obj, UiBool fill) {
125 UiContainer *ct = uic_get_current_container(obj);
126 UIlayout_fill(ct, fill);
127 }
128
129 void ui_layout_hexpand(UiObject *obj, UiBool expand) {
130 UiContainer *ct = uic_get_current_container(obj);
131 UIlayout_hexpand(ct, expand);
132 }
133
134 void ui_layout_vexpand(UiObject *obj, UiBool expand) {
135 UiContainer *ct = uic_get_current_container(obj);
136 UIlayout_vexpand(ct, expand);
137 }
138
139 void ui_layout_gridwidth(UiObject *obj,
int width) {
140 UiContainer *ct = uic_get_current_container(obj);
141 UIlayout_gridwidth(ct, width);
142 }
143
144 void ui_newline(UiObject *obj) {
145 UiContainer *ct = uic_get_current_container(obj);
146 UIlayout_newline(ct);
147 }