summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authormdejong <mdejong>2006-12-12 23:38:22 (GMT)
committermdejong <mdejong>2006-12-12 23:38:22 (GMT)
commit3954c391dbfff265521c67f0ed568ab874b213f1 (patch)
tree4efb7b2d5f99ee7de0b325a3fe019874cead3e3c /win/tkWinButton.c
parent817b914d518b7afafd8e2cb2d2f44b25ffbc91c2 (diff)
downloadtk-3954c391dbfff265521c67f0ed568ab874b213f1.zip
tk-3954c391dbfff265521c67f0ed568ab874b213f1.tar.gz
tk-3954c391dbfff265521c67f0ed568ab874b213f1.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]
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c7
1 files changed, 5 insertions, 2 deletions
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);
}