summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index b9ee7a3..720e40d 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -52,13 +52,13 @@ static NSRect TkMacOSXGetButtonFrame(TkButton *butPtr);
NSRect Tkframe = TkMacOSXGetButtonFrame(butPtr);
Tk_Window tkwin = butPtr->tkwin;
/* Do not draw if the widget is misplaced or unmapped. */
- if ( NSIsEmptyRect(Tkframe) ||
+ if ( NSIsEmptyRect(Tkframe) ||
! macWin->winPtr->flags & TK_MAPPED ||
- ! NSEqualRects(Tkframe, [self frame])
+ ! NSEqualRects(Tkframe, [self frame])
) {
return;
}
- /* Do not draw if the widget is completely outside of its parent, or within 20 pixels of the lower border; this prevents buttons from being drawn on peer widgets as scrolling occurs. */
+ /* Do not draw if the widget is completely outside of its parent, or within 20 pixels of the lower border; this prevents buttons from being drawn on peer widgets as scrolling occurs. */
if (tkwin) {
int parent_height = Tk_Height(Tk_Parent(tkwin));
int widget_height = Tk_Height(tkwin);
@@ -71,14 +71,13 @@ static NSRect TkMacOSXGetButtonFrame(TkButton *butPtr);
int parent_width = Tk_Width(Tk_Parent(tkwin));
int widget_width = Tk_Width(tkwin);
int x = Tk_X(tkwin);
- if (x > parent_width - 50 || x < 0) {
+ if (x > parent_width - 50 || x < 0) {
return;
}
-
}
- }
[super drawRect:dirtyRect];
}
+ }
@end
@@ -136,7 +135,7 @@ static void ComputeUnixButtonGeometry(TkButton *butPtr);
* The class procedure table for the button widgets.
*/
-Tk_ClassProcs tkpButtonProcs = {
+const Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
NULL, /* createProc */
@@ -164,7 +163,7 @@ TkButton *
TkpCreateButton(
Tk_Window tkwin)
{
- MacButton *macButtonPtr = (MacButton *) ckalloc(sizeof(MacButton));
+ MacButton *macButtonPtr = ckalloc(sizeof(MacButton));
macButtonPtr->button = nil;
macButtonPtr->image = nil;
@@ -563,7 +562,7 @@ ComputeNativeButtonGeometry(
}
break;
case TYPE_RADIO_BUTTON:
- case TYPE_CHECK_BUTTON:
+ case TYPE_CHECK_BUTTON:
if (!haveImage /*|| butPtr->indicatorOn*/) { // TODO: indicatorOn
type = butPtr->type == TYPE_RADIO_BUTTON ?
NSRadioButton : NSSwitchButton;
@@ -588,7 +587,7 @@ ComputeNativeButtonGeometry(
}
[button setButtonType:type];
if (style) {
- [button setBezelStyle:style];
+ [button setBezelStyle:style];
}
if (highlightsBy) {
[cell setHighlightsBy:highlightsBy|[cell highlightsBy]];
@@ -715,7 +714,7 @@ ComputeNativeButtonGeometry(
Tk_FontMetrics fm;
Tk_GetFontMetrics(butPtr->tkfont, &fm);
if (fm.linespace > 18) {
- [button setBezelStyle:(style = NSRegularSquareBezelStyle)];
+ [button setBezelStyle:(style = NSShadowlessSquareBezelStyle)];
}
}