diff -r dbde25a5bc53 -r c03c338a7dcf ui/gtk/text.h --- a/ui/gtk/text.h Tue Jan 24 18:46:47 2017 +0100 +++ b/ui/gtk/text.h Fri Nov 10 17:17:14 2017 +0100 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2014 Olaf Wintermann. All rights reserved. + * Copyright 2017 Olaf Wintermann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +32,7 @@ #include "../ui/text.h" #include "toolkit.h" #include "../../ucx/list.h" +#include "../common/context.h" #ifdef __cplusplus extern "C" { @@ -56,9 +57,19 @@ typedef struct UiTextArea { UiContext *ctx; - int last_selection_state; + UiVar *var; + int last_selection_state; } UiTextArea; +typedef struct UiTextField { + UiContext *ctx; + UiVar *var; + // TODO: validatefunc +} UiTextField; + +UIWIDGET ui_textarea_var(UiObject *obj, UiVar *var); +void ui_textarea_destroy(GtkWidget *object, UiTextArea *textarea); + char* ui_textarea_get(UiText *text); void ui_textarea_set(UiText *text, char *str); char* ui_textarea_getsubstr(UiText *text, int begin, int end); @@ -85,6 +96,8 @@ void ui_free_textbuf_op(UiTextBufOp *op); int ui_check_insertstr(char *oldstr, int oldlen, char *newstr, int newlen); +void ui_textfield_destroy(GtkWidget *object, UiTextField *textfield); + char* ui_textfield_get(UiString *str); void ui_textfield_set(UiString *str, char *value);