ui/gtk/widget.c

changeset 962
7016bcb8d38b
parent 801
e096c441e874
equal deleted inserted replaced
961:687f43736aef 962:7016bcb8d38b
29 #include "widget.h" 29 #include "widget.h"
30 #include "container.h" 30 #include "container.h"
31 31
32 #include "../common/object.h" 32 #include "../common/object.h"
33 33
34 UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) { 34 void ui_widget_size_request(UIWIDGET w, int width, int height) {
35 if(width > 0 || height > 0) {
36 if(width == 0) {
37 width = -1;
38 }
39 if(height == 0) {
40 height = -1;
41 }
42 gtk_widget_set_size_request(w, width, height);
43 }
44 }
45
46
47 UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs *args) {
35 UIWIDGET widget = create_widget(obj, args, userdata); 48 UIWIDGET widget = create_widget(obj, args, userdata);
36 49
37 UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end; 50 UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
38 UiLayout layout = UI_ARGS2LAYOUT(args); 51 UiLayout layout = UI_ARGS2LAYOUT(args);
39 ct->add(ct, widget, &layout); 52 ct->add(ct, widget, &layout);

mercurial