summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-04-07 01:12:53 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-04-07 01:12:53 (GMT)
commit601d5cb9083936b984e2e638adc9f82f3f5c268f (patch)
tree613198942a873bcc72239c60dd857e0c8ed72fb4 /generic
parent5417aced62272c4a65e844c162350f04ad5413fe (diff)
downloadtk-601d5cb9083936b984e2e638adc9f82f3f5c268f.zip
tk-601d5cb9083936b984e2e638adc9f82f3f5c268f.tar.gz
tk-601d5cb9083936b984e2e638adc9f82f3f5c268f.tar.bz2
Further cleanup of scrolling, drawing, resize in Cocoa; thanks to Marc Culler for patches
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvas.c13
-rw-r--r--generic/tkInt.decls3
-rw-r--r--generic/tkIntPlatDecls.h6
-rw-r--r--generic/tkTextDisp.c29
4 files changed, 34 insertions, 17 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 14fe1ab..8ebe9ba 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2101,6 +2101,19 @@ DisplayCanvas(
goto done;
}
+#ifdef MAC_OSX_TK
+ /*
+ * If drawing is disabled, all we need to do is
+ * clear the REDRAW_PENDING flag.
+ */
+ TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin);
+ MacDrawable *macWin = winPtr->privatePtr;
+ if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){
+ canvasPtr->flags &= ~REDRAW_PENDING;
+ return;
+ }
+#endif
+
/*
* Choose a new current item if that is needed (this could cause event
* handlers to be invoked).
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index ab56bed..7921852 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -956,6 +956,9 @@ declare 50 aqua {
declare 51 aqua {
void TkGenWMDestroyEvent(Tk_Window tkwin)
}
+declare 52 aqua {
+ TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
+}
# removed duplicate from tkPlat table (tk.decls)
#declare 52 aqua {
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index b377173..7654b5d 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -520,7 +520,11 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window,
/* 51 */
EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
#endif
-/* Slot 52 is reserved */
+#ifndef TkMacOSXSetDrawingEnabled_TCL_DECLARED
+#define TkMacOSXSetDrawingEnabled_TCL_DECLARED
+/* 52 */
+EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
+#endif
#ifndef TkpGetMS_TCL_DECLARED
#define TkpGetMS_TCL_DECLARED
/* 53 */
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index bcbb03a..5f69690 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3954,6 +3954,19 @@ DisplayText(
return;
}
+#ifdef MAC_OSX_TK
+ /*
+ * If drawing is disabled, all we need to do is
+ * clear the REDRAW_PENDING flag.
+ */
+ TkWindow *winPtr = (TkWindow *)(textPtr->tkwin);
+ MacDrawable *macWin = winPtr->privatePtr;
+ if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){
+ dInfoPtr->flags &= ~REDRAW_PENDING;
+ return;
+ }
+#endif
+
interp = textPtr->interp;
Tcl_Preserve((ClientData) interp);
@@ -3961,14 +3974,6 @@ DisplayText(
Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY);
}
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
- /*
- * The widget has been deleted. Don't do anything.
- */
-
- goto end;
- }
-
if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x)
|| (dInfoPtr->maxY <= dInfoPtr->y)) {
UpdateDisplayInfo(textPtr);
@@ -3980,14 +3985,6 @@ DisplayText(
Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY);
}
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
- /*
- * The widget has been deleted. Don't do anything.
- */
-
- goto end;
- }
-
/*
* Choose a new current item if that is needed (this could cause event
* handlers to be invoked, hence the preserve/release calls and the loop,