summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2004-11-10 17:29:44 (GMT)
committerwolfsuit <wolfsuit>2004-11-10 17:29:44 (GMT)
commitf4d485d83668861b7724e5349c8b5c3d4f70e28c (patch)
tree71b04ce2160d21c55831a8924c860a476e630ee9 /macosx/tkMacOSXButton.c
parent4dfa2a7e6376de3e5ff062c9a0cde73050d7a9a1 (diff)
downloadtk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.zip
tk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.tar.gz
tk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.tar.bz2
Fix for 1055023 from mikek@muonics.com.
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 9cd2994..b3935a1 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXButton.c,v 1.2.2.5 2004/02/16 00:42:34 wolfsuit Exp $
+ * RCS: @(#) $Id: tkMacOSXButton.c,v 1.2.2.6 2004/11/10 17:29:45 wolfsuit Exp $
*/
#include "tkButton.h"
@@ -309,7 +309,7 @@ TkpDisplayButton(
fullWidth = 0;
fullHeight = 0;
- switch ((enum compound) butPtr->compound) {
+ switch ((enum compound) butPtr->compound)
case COMPOUND_TOP:
case COMPOUND_BOTTOM: {
/* Image is above or below text */
@@ -324,9 +324,8 @@ TkpDisplayButton(
textXOffset = (fullWidth - butPtr->textWidth)/2;
imageXOffset = (fullWidth - width)/2;
break;
- }
case COMPOUND_LEFT:
- case COMPOUND_RIGHT: {
+ case COMPOUND_RIGHT:
/*
* Image is left or right of text
*/
@@ -342,8 +341,7 @@ TkpDisplayButton(
textYOffset = (fullHeight - butPtr->textHeight)/2;
imageYOffset = (fullHeight - height)/2;
break;
- }
- case COMPOUND_CENTER: {
+ case COMPOUND_CENTER:
/*
* Image and text are superimposed
*/
@@ -357,8 +355,8 @@ TkpDisplayButton(
textYOffset = (fullHeight - butPtr->textHeight)/2;
imageYOffset = (fullHeight - height)/2;
break;
- }
- case COMPOUND_NONE: {break;}
+ case COMPOUND_NONE:
+ break;
}
TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
@@ -967,9 +965,15 @@ TkMacOSXDrawControl(
Tk_Font font;
int len;
- len = TkFontGetFirstTextLayout(butPtr->textLayout,
- &font, controlTitle);
- controlTitle[len] = 0;
+ if (((mbPtr->info.image == NULL) && (mbPtr->info.bitmap == None))
+ || (mbPtr->info.compound != COMPOUND_NONE)) {
+ len = TkFontGetFirstTextLayout(butPtr->textLayout,
+ &font, controlTitle);
+ controlTitle[len] = 0;
+ } else {
+ len = 0;
+ controlTitle[0] = 0;
+ }
if (bcmp(mbPtr->controlTitle, controlTitle, len+1)) {
CFStringRef cf;
cf = CFStringCreateWithCString(NULL,