aboutsummaryrefslogtreecommitdiffstats
path: root/widget_text.c
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-01-20 06:37:35 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-01-20 06:37:35 +0000
commitceb6fc010ee9f4fadbcbf3e3cdc481ec505cdc32 (patch)
tree8b0d4a217ccc9c6a61b4a72cfedf487433fb01e0 /widget_text.c
parent883d1546b2cc19b1ae1b0041cb8131baea814336 (diff)
downloadlcd4linux-ceb6fc010ee9f4fadbcbf3e3cdc481ec505cdc32.tar.gz
dynamic properties for bars; new 'property_valid()' helper
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@749 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget_text.c')
-rw-r--r--widget_text.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/widget_text.c b/widget_text.c
index 688fe70..a0b08ad 100644
--- a/widget_text.c
+++ b/widget_text.c
@@ -161,9 +161,10 @@ void widget_text_update(void *Self)
char *string;
int update = 0;
- /* evaluate prefix and postfix */
+ /* evaluate properties */
update += property_eval(&T->prefix);
update += property_eval(&T->postfix);
+ update += property_eval(&T->style);
/* evaluate value */
property_eval(&T->value);
@@ -211,9 +212,6 @@ void widget_text_update(void *Self)
free(string);
}
- /* text style */
- update += property_eval(&T->style);
-
/* something has changed and should be updated */
if (update) {
/* reset marquee counter if content has changed */
@@ -246,9 +244,14 @@ int widget_text_init(WIDGET * Self)
/* load properties */
property_load(section, "prefix", NULL, &Text->prefix);
- property_load(section, "expression", NULL, &Text->value);
+ property_load(section, "expression", "", &Text->value);
property_load(section, "postfix", NULL, &Text->postfix);
- property_load(section, "style", "'norm'", &Text->style);
+ property_load(section, "style", NULL, &Text->style);
+
+ /* sanity checks */
+ if (!property_valid(&Text->value)) {
+ error("Warning: widget %s has no expression", section);
+ }
/* field width, default 10 */
cfg_number(section, "width", 10, 0, -1, &(Text->width));