aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gwin/gwin_widget.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c
index 666987ac..6002ffa9 100644
--- a/src/gwin/gwin_widget.c
+++ b/src/gwin/gwin_widget.c
@@ -382,10 +382,10 @@ const GWidgetStyle *gwinGetDefaultStyle(void) {
return defaultStyle;
}
-
void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) {
- if (!(gh->flags & GWIN_FLG_WIDGET))
+ if (!(gh->flags & GWIN_FLG_WIDGET)) {
return;
+ }
// Dispose of the old string
if ((gh->flags & GWIN_FLG_ALLOCTXT)) {
@@ -397,9 +397,9 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) {
}
// Alloc the new text if required
- if (!text || !*text)
+ if (!text || !*text) {
gw->text = "";
- else if (useAlloc) {
+ } else if (useAlloc) {
char *str;
if ((str = gfxAlloc(strlen(text)+1))) {
@@ -407,8 +407,10 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) {
strcpy(str, text);
}
gw->text = (const char *)str;
- } else
+ } else {
gw->text = text;
+ }
+
_gwinUpdate(gh);
}