summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2014-09-23 14:25:17 (GMT)
committerKevin Walzer <kw@codebykevin.com>2014-09-23 14:25:17 (GMT)
commite11d1bc0cb52ca2873204e1e8db7b67ed5fff7be (patch)
tree9bb2baa5968ef2217b2ae3909e37029417b29558 /macosx/tkMacOSXButton.c
parentdf3fb86c8aedf3f02e9ccf7ffc78a063b04c9992 (diff)
downloadtk-e11d1bc0cb52ca2873204e1e8db7b67ed5fff7be.zip
tk-e11d1bc0cb52ca2873204e1e8db7b67ed5fff7be.tar.gz
tk-e11d1bc0cb52ca2873204e1e8db7b67ed5fff7be.tar.bz2
Fine-tune display of buttons on Tk/Cocoa on horizontal scroll
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 95611d0..58383ca 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -67,6 +67,13 @@ static NSRect TkMacOSXGetButtonFrame(TkButton *butPtr);
return;
}
+ int parent_width = Tk_Width(Tk_Parent(tkwin));
+ int widget_width = Tk_Width(tkwin);
+ int x = Tk_X(tkwin);
+ if (x > parent_width - 30 || x + widget_width < 0) {
+ return;
+ }
+
}
}
[super drawRect:dirtyRect];