From c384252bc61cfdd0b61ae070cb2b779535e9a2fd Mon Sep 17 00:00:00 2001 From: marco candrian Date: Sun, 17 Feb 2008 08:36:58 +0100 Subject: [PATCH] iconbox handles the property arguments image are supported actually --- widgets/iconbox.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/widgets/iconbox.c b/widgets/iconbox.c index e9d6e6f90..cb137dae7 100644 --- a/widgets/iconbox.c +++ b/widgets/iconbox.c @@ -71,9 +71,31 @@ iconbox_tell(Widget *widget, char *property, char *command) if(!property || !command) return; - if(d->image) - p_delete(&d->image); - d->image = a_strdup(command); + if(!a_strcmp(property, "image")) + { + if(d->image) + p_delete(&d->image); + d->image = a_strdup(command); + } + else if(!a_strcmp(property, "resize")) /* XXX how to ignorecase compare? */ + { + if(!a_strcmp(command, "true") || !a_strcmp(command, "1")) + d->resize = True; + else if (!a_strcmp(command, "false") || !a_strcmp(command, "0")) + d->resize = False; + else + warn("Resize value must be (case-sensitive) \"true\", \"false\",\ + \"1\" or \"0\". But is: %s.\n", command); + } + else if(!a_strcmp(property, "align") || !a_strcmp(property, "mouse") || + !a_strcmp(property, "x") || !a_strcmp(property, "y")) + warn("Property \"%s\" can't get changed.\n", property); + + else + { + warn("No such property: %s\n", property); + return; + } } Widget *