Subject: Fix from kevin_walzer for buttons in cocoa

From: hypnotoad <[email-masked]>
Date: Wed, 27 Aug 2014 14:52:58 +0000

---
 macosx/tkMacOSXButton.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 4e7904c..9858f88 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -186,6 +186,7 @@ TkpDestroyButton(
     TkButton *butPtr)
 {
     MacButton *macButtonPtr = (MacButton *) butPtr;
+    [macButtonPtr->button setTag:(NSInteger)-1];
 
     TkMacOSXMakeCollectableAndRelease(macButtonPtr->button);
     TkMacOSXMakeCollectableAndRelease(macButtonPtr->selectImage);
@@ -375,17 +376,10 @@ NSRect TkMacOSXGetButtonFrame(
 {
     MacButton *macButtonPtr = (MacButton *) butPtr;
     Tk_Window tkwin = butPtr->tkwin;
-    unsigned short tkwint=(unsigned int)tkwin;
     TkWindow *winPtr = (TkWindow *) tkwin;
-    if(tkwint==0xffffffff || tkwint==0) {
-	return NSZeroRect;
-    }
     if (tkwin) {
 	MacDrawable *macWin =  (MacDrawable *) winPtr->window;
 	NSView *view = TkMacOSXDrawableView(macWin);
-        if(view==nil) {
-            return NSZeroRect;
-        }
 	CGFloat viewHeight = [view bounds].size.height;
 	NSRect frame = NSMakeRect(macWin->xOff, macWin->yOff,
 				  Tk_Width(tkwin), Tk_Height(tkwin));
-- 
cgit v0.12