diff -r 5223de7979e2 -r d51e334c1439 ui/gtk/text.c --- a/ui/gtk/text.c Thu Aug 20 17:14:27 2015 +0200 +++ b/ui/gtk/text.c Sat Oct 10 15:29:31 2015 +0200 @@ -456,7 +456,15 @@ UIWIDGET ui_textfield(UiObject *obj, UiString *value) { + return ui_textfield_w(obj, 0, value); +} + +UIWIDGET ui_textfield_w(UiObject *obj, int width, UiString *value) { GtkWidget *textfield = gtk_entry_new(); + if(width > 0) { + gtk_entry_set_width_chars(GTK_ENTRY(textfield), width); + } + UiContainer *ct = uic_get_current_container(obj); ct->add(ct, textfield, FALSE); @@ -477,10 +485,14 @@ } UIWIDGET ui_textfield_nv(UiObject *obj, char *varname) { + return ui_textfield_wnv(obj, 0, varname); +} + +UIWIDGET ui_textfield_wnv(UiObject *obj, int width, char *varname) { UiVar *var = uic_connect_var(obj->ctx, varname, UI_VAR_STRING); if(var) { UiString *value = var->value; - return ui_textfield(obj, value); + return ui_textfield_w(obj, width, value); } else { // TODO: error }