#include "widget.h"
#include "container.h"
#include "../common/object.h"
UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget,
void *userdata, UiWidgetArgs *args) {
UiObject* current = uic_current_obj(obj);
UIWIDGET widget = create_widget(obj, args, userdata);
UI_APPLY_LAYOUT2(current, args);
current->container->add(current->container, widget);
return widget;
}
UIWIDGET ui_separator_create(UiObject *obj, UiWidgetArgs *args) {
UiObject* current = uic_current_obj(obj);
GtkWidget *widget = gtk_separator_new(
GTK_ORIENTATION_HORIZONTAL);
ui_set_name_and_style(widget, args->name, args->style_class);
UI_APPLY_LAYOUT1(current, (*args));
current->container->add(current->container, widget);
return widget;
}
void ui_widget_set_size(
UIWIDGET w,
int width,
int height) {
gtk_widget_set_size_request(w, width, height);
}
void ui_widget_redraw(
UIWIDGET w) {
gtk_widget_queue_draw(w);
}