summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authortreectrl <treectrl>2005-05-20 20:51:08 (GMT)
committertreectrl <treectrl>2005-05-20 20:51:08 (GMT)
commita66620b1d434505637529433127cc399a610ecfd (patch)
tree572ab1f3806df5ea49690416ec1a347ab5cbaa06 /generic
parent36224d200b1e5c0aeb7698dae3b2a361536728d8 (diff)
downloadtktreectrl-a66620b1d434505637529433127cc399a610ecfd.zip
tktreectrl-a66620b1d434505637529433127cc399a610ecfd.tar.gz
tktreectrl-a66620b1d434505637529433127cc399a610ecfd.tar.bz2
Put back Tk_FillRegion() change.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTreeUtils.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c
index cd1c6ce..74e3c29 100644
--- a/generic/tkTreeUtils.c
+++ b/generic/tkTreeUtils.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2002-2005 Tim Baker
*
- * RCS: @(#) $Id: tkTreeUtils.c,v 1.16 2005/05/19 20:28:13 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeUtils.c,v 1.17 2005/05/20 20:51:08 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -14,8 +14,10 @@
#endif
/* OffsetRgn() on Mac */
-#ifdef MAC_OSX_TK
+#if defined(MAC_OSX_TK)
#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+static PixPathHandle gPenPat = NULL;
#endif
/*
@@ -469,6 +471,25 @@ void Tk_FillRegion(Display *display, Drawable drawable, GC gc, TkRegion rgn)
FillRgn(dc, (HRGN) rgn, brush);
DeleteObject(brush);
TkWinReleaseDrawableDC(drawable, dc, &dcState);
+#elif defined(TARGET_OS_MAC)
+ MacDrawable *macWin = (MacDrawable *) d;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ RGBColor macColor;
+
+ destPort = TkMacOSXGetDrawablePort(drawable);
+ if (gPenPat == NULL)
+ gPenPat = NewPixPat();
+ if (TkSetMacColor(gc->foreground, &macColor) == true)
+ MakeRGBPat(gPenPath, &macColor);
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(drawable);
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+ FillCRgn((RgnHandle) rgn, gPenPat);
+ SetGWorld(saveWorld, saveDevice);
#else
XRectangle box;