From 226b078bd6a53a1653f61c533c87568871fa03d7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 15 Nov 2020 21:16:56 +0000 Subject: Backout previous commit, which wasn't such a good idea after all (the changeProc must exist in Tk_GetImage otherwise there are crashes, for instance in DeleteImage). Plan B is to use the same error message as in Tk_GetImage, to provide plaftorm consistency. --- win/tkWinSysTray.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/win/tkWinSysTray.c b/win/tkWinSysTray.c index 0d45dbb..68a2dcc 100644 --- a/win/tkWinSysTray.c +++ b/win/tkWinSysTray.c @@ -977,11 +977,11 @@ CreateIcoFromTkImage( unsigned size; BITMAPINFO bmInfo; ICONINFO iconInfo; - Tk_Image tk_image; - Tk_Window tkwin = Tk_MainWindow(interp); - tk_image = Tk_GetImage(interp, tkwin, image, NULL, NULL); - if (tk_image == NULL) { + photo = Tk_FindPhoto(interp, image); + if (photo == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "image \"%s\" doesn't exist", image)); return NULL; } @@ -998,7 +998,6 @@ CreateIcoFromTkImage( iconBits->nNumImages = 1; - photo = Tk_FindPhoto(interp, image); Tk_PhotoGetSize(photo, &width, &height); Tk_PhotoGetImage(photo, &block); -- cgit v0.12