summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXScrlbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXScrlbr.c')
-rw-r--r--macosx/tkMacOSXScrlbr.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c
index 0b4fa61..67d79c9 100644
--- a/macosx/tkMacOSXScrlbr.c
+++ b/macosx/tkMacOSXScrlbr.c
@@ -54,7 +54,7 @@ static void ScrollbarEventProc(ClientData clientData,
* The class procedure table for the scrollbar widget.
*/
-Tk_ClassProcs tkpScrollbarProcs = {
+const Tk_ClassProcs tkpScrollbarProcs = {
sizeof(Tk_ClassProcs), /* size */
NULL, /* worldChangedProc */
NULL, /* createProc */
@@ -115,7 +115,7 @@ Tk_ClassProcs tkpScrollbarProcs = {
Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
if (result != TCL_OK && result != TCL_CONTINUE && result != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (scrollbar command)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_Release(scrollPtr);
Tcl_Release(interp);
@@ -225,11 +225,11 @@ TkScrollbar *
TkpCreateScrollbar(
Tk_Window tkwin)
{
- MacScrollbar *scrollPtr = (MacScrollbar *) ckalloc(sizeof(MacScrollbar));
+ MacScrollbar *scrollPtr = ckalloc(sizeof(MacScrollbar));
scrollPtr->scroller = nil;
Tk_CreateEventHandler(tkwin, StructureNotifyMask|FocusChangeMask|
- ActivateMask|ExposureMask, ScrollbarEventProc, (ClientData) scrollPtr);
+ ActivateMask|ExposureMask, ScrollbarEventProc, scrollPtr);
return (TkScrollbar *) scrollPtr;
}
@@ -282,8 +282,8 @@ void
TkpDisplayScrollbar(
ClientData clientData) /* Information about window. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
- MacScrollbar *macScrollPtr = (MacScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
+ MacScrollbar *macScrollPtr = clientData;
NSScroller *scroller = macScrollPtr->scroller;
Tk_Window tkwin = scrollPtr->tkwin;
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -331,6 +331,26 @@ TkpDisplayScrollbar(
frame = NSInsetRect(frame, scrollPtr->inset, scrollPtr->inset);
frame.origin.y = viewHeight - (frame.origin.y + frame.size.height);
+ NSWindow *w = [view window];
+
+ //This uses a private API call that is no longer needed on systems >= 10.7.
+ #if 0
+ if ([w showsResizeIndicator]) {
+ NSRect growBox = [view convertRect:[w _growBoxRect] fromView:nil];
+
+ if (NSIntersectsRect(growBox, frame)) {
+ if (scrollPtr->vertical) {
+ CGFloat y = frame.origin.y;
+
+ frame.origin.y = growBox.origin.y + growBox.size.height;
+ frame.size.height -= frame.origin.y - y;
+ } else {
+ frame.size.width = growBox.origin.x - frame.origin.x;
+ }
+ TkMacOSXSetScrollbarGrow(winPtr, true);
+ }
+ }
+ #endif
if (!NSEqualRects(frame, [scroller frame])) {
[scroller setFrame:frame];
}
@@ -580,7 +600,7 @@ ScrollbarEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
switch (eventPtr->type) {
case UnmapNotify:
@@ -588,7 +608,7 @@ ScrollbarEventProc(
break;
case ActivateNotify:
case DeactivateNotify:
- TkScrollbarEventuallyRedraw((ClientData) scrollPtr);
+ TkScrollbarEventuallyRedraw(scrollPtr);
break;
default:
TkScrollbarEventProc(clientData, eventPtr);