From 6b36f92065f054abd810d956169a87180677d4f7 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 18 Feb 2002 16:03:54 +0000 Subject: Passage des couleurs en gradients pour uniformiser --- generic/tkZinc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'generic/tkZinc.c') diff --git a/generic/tkZinc.c b/generic/tkZinc.c index b754a7b..f4c1394 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -428,6 +428,7 @@ ZincObjCmd(ClientData client_data, /* Main window associated with wi->realized = False; wi->update_pending = 0; wi->fore_color = NULL; + wi->fore_gradient = NULL; wi->back_color = NULL; wi->relief_grad = NULL; wi->bbox_color = NULL; @@ -4219,7 +4220,16 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */ if (wi->pick_aperture < 0) { wi->pick_aperture = 0; } - + if (CONFIG_PROBE(FORE_COLOR_SPEC) || !wi->fore_gradient) { + /* + * Update the default gradient. + */ + if (wi->fore_gradient) { + ZnFreeGradient(wi->fore_gradient); + } + wi->fore_gradient = ZnGetGradient(wi->interp, wi->win, + ZnNameOfColor(wi->fore_color)); + } if (CONFIG_PROBE(BACK_COLOR_SPEC) || !wi->relief_grad) { Tk_SetWindowBackground(wi->win, ZnPixel(wi->back_color)); if (wi->relief_grad) { @@ -5355,7 +5365,11 @@ Destroy(char *mem_ptr) /* Info about the widget. */ XFree(wi->gl_visual); } #endif - + + if (wi->fore_gradient) { + ZnFreeGradient(wi->fore_gradient); + } + Tcl_DeleteTimerHandler(wi->blink_handler); Tk_FreeOptions(config_specs, (char *) wi, wi->dpy, 0); -- cgit v1.1