diff options
Diffstat (limited to 'generic/tkTreeUtils.c')
-rw-r--r-- | generic/tkTreeUtils.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c index 9ada3e9..7459fe6 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.14 2005/05/17 01:21:14 treectrl Exp $ + * RCS: @(#) $Id: tkTreeUtils.c,v 1.15 2005/05/19 00:42:04 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -16,6 +16,8 @@ /* OffsetRgn() on Mac */ #ifdef TARGET_OS_MAC #include <Carbon/Carbon.h> +#include "tkMacOSXInt.h" +static PixPathHandle gPenPat = NULL; #endif /* @@ -469,7 +471,25 @@ void Tk_FillRegion(Display *display, Drawable drawable, GC gc, TkRegion rgn) FillRgn(dc, (HRGN) rgn, brush); DeleteObject(brush); TkWinReleaseDrawableDC(drawable, dc, &dcState); -/* Apparently this works on Mac Aqua as well as Unix */ +#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; |