From 6caf48541c874629c3d5b8b7dd2ad7241612adbd Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 15 Mar 2002 14:24:16 +0000 Subject: Ajustement des ressources couleurs pour tenir compte de la g�n�ralisation des gradients. Traitement centralis� des images. --- generic/Icon.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/generic/Icon.c b/generic/Icon.c index d824c0c..1672c2f 100644 --- a/generic/Icon.c +++ b/generic/Icon.c @@ -154,7 +154,7 @@ Init(Item item, icon->anchor = ZnAnchorNW; icon->connection_anchor = ZnAnchorSW; icon->mask = ZnUnspecifiedPattern; - icon->color = ZnGetGradientByValue(wi->fore_gradient); + icon->color = ZnGetGradientByValue(wi->fore_color); return ZN_OK; } @@ -174,7 +174,7 @@ Clone(Item item) WidgetInfo *wi = item->wi; char *text; - if (strlen(icon->image_name) != 0) { + if (icon->image != ZnUnspecifiedImage) { text = ZnMalloc((strlen(icon->image_name) + 1) * sizeof(char)); strcpy(text, icon->image_name); icon->image_name = text; @@ -255,26 +255,10 @@ Configure(Item item, } if (ISSET(*flags, ZN_IMAGE_FLAG)) { - Tk_Image image; - - if (strcmp(icon->image_name, "") != 0) { - image = Tk_GetImage(wi->interp, wi->win, icon->image_name, - IconImageChange, (ClientData) icon); - if (image == NULL) { - /* - * The name will not be in sync with the image in - * this case. - */ - return ZN_ERROR; - } - } - else { - image = ZnUnspecifiedImage; - } - if (icon->image != ZnUnspecifiedImage) { - Tk_FreeImage(icon->image); + if (ValidateImage(wi, item, icon->image_name, IconImageChange, + &icon->image, "icon -image") == ZN_ERROR) { + return ZN_ERROR; } - icon->image = image; } return ZN_OK; -- cgit v1.1