summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdejong <mdejong>2006-12-12 23:38:22 (GMT)
committermdejong <mdejong>2006-12-12 23:38:22 (GMT)
commite391a56a075738f58033ef628b4b47f405b7f188 (patch)
tree4efb7b2d5f99ee7de0b325a3fe019874cead3e3c
parent33326ea32c79edfa2454c8e4509a8041b4c9519b (diff)
downloadtk-e391a56a075738f58033ef628b4b47f405b7f188.zip
tk-e391a56a075738f58033ef628b4b47f405b7f188.tar.gz
tk-e391a56a075738f58033ef628b4b47f405b7f188.tar.bz2
* win/tkWinButton.c (InitBoxes): Call Tcl_Panic()
if loading of bitmap resources fails. This change generates an error if Tk is unable to find button widget resources instead of silently failing and then drawing widgets incorrectly. win/rc/tk_base.rc: If the user defines BASE_NO_TK_ICON then compile the base resources file without a "tk" icon. This change makes it easier to replace the default tk icon with a custom icon. [Patch 1614362]
-rw-r--r--ChangeLog13
-rw-r--r--win/rc/tk_base.rc9
-rw-r--r--win/tkWinButton.c7
3 files changed, 26 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e55d24d..54ca60e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-12-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinButton.c (InitBoxes): Call Tcl_Panic()
+ if loading of bitmap resources fails. This change
+ generates an error if Tk is unable to find button
+ widget resources instead of silently failing and
+ then drawing widgets incorrectly.
+ win/rc/tk_base.rc: If the user defines BASE_NO_TK_ICON
+ then compile the base resources file without a
+ "tk" icon. This change makes it easier to replace the
+ default tk icon with a custom icon.
+ [Patch 1614362]
+
2006-12-11 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
* unix/tkUnixWm.c (TkWmMapWindow, WmClientCmd): Added support for
diff --git a/win/rc/tk_base.rc b/win/rc/tk_base.rc
index fa7dc9a..456a5aa 100644
--- a/win/rc/tk_base.rc
+++ b/win/rc/tk_base.rc
@@ -1,4 +1,4 @@
-// RCS: @(#) $Id: tk_base.rc,v 1.3 2004/01/13 02:01:55 davygrvy Exp $
+// RCS: @(#) $Id: tk_base.rc,v 1.4 2006/12/12 23:38:22 mdejong Exp $
//
// Base resources needed by Tk whether it's a DLL or a static library.
//
@@ -8,8 +8,15 @@
//
// Tk Icon
//
+// The BASE_NO_TK_ICON symbol can be defined to avoid
+// creating an icon named "tk" in this resource file.
+// The user can then create another icon named tk in
+// another resource file and link both resource files.
+// Tk will then use the custom icon instead of tk.ico.
+#ifndef BASE_NO_TK_ICON
tk ICON DISCARDABLE "tk.ico"
+#endif
#include <dlgs.h>
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index c7efb90..4503595 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinButton.c,v 1.28 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.29 2006/12/12 23:38:22 mdejong Exp $
*/
#define OEMRESOURCE
@@ -134,7 +134,10 @@ InitBoxes(void)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
hrsrc = FindResource(module, "buttons", RT_BITMAP);
- if (hrsrc) {
+ if (hrsrc == NULL) {
+ Tcl_Panic("FindResource() failed for buttons bitmap resource, "
+ "resources in tk_base.rc must be linked into Tk dll or static executable");
+ } else {
hblk = LoadResource(module, hrsrc);
tsdPtr->boxesPtr = (LPBITMAPINFOHEADER)LockResource(hblk);
}