30 #include "container.h" |
30 #include "container.h" |
31 #include "toolkit.h" |
31 #include "toolkit.h" |
32 |
32 |
33 UIWIDGET ui_button(UiObject *obj, char *label, ui_callback f, void *data) { |
33 UIWIDGET ui_button(UiObject *obj, char *label, ui_callback f, void *data) { |
34 QString str = QString::fromUtf8(label); |
34 QString str = QString::fromUtf8(label); |
35 QPushButton *button = new QPushButton(label); |
35 QPushButton *button = new QPushButton(str); |
36 |
36 |
37 if(f) { |
37 if(f) { |
38 UiEventWrapper *event = new UiEventWrapper(obj, f, data); |
38 UiEventWrapper *event = new UiEventWrapper(obj, f, data); |
39 button->connect(button, SIGNAL(clicked()), event, SLOT(slot())); |
39 button->connect(button, SIGNAL(clicked()), event, SLOT(slot())); |
40 } |
40 } |