summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorculler <culler>2019-04-24 17:35:10 (GMT)
committerculler <culler>2019-04-24 17:35:10 (GMT)
commitbf19ff82cc3fb7362d1b9f268e090b7668d65239 (patch)
tree191342bc7580d5880dbc99342cb1e24f200600c2 /macosx/tkMacOSXDraw.c
parentc48fd5cadb4b8faadbd12969719825c5548df544 (diff)
parent992e83396570dcf0c161abd79226964eb535ad57 (diff)
downloadtk-bf19ff82cc3fb7362d1b9f268e090b7668d65239.zip
tk-bf19ff82cc3fb7362d1b9f268e090b7668d65239.tar.gz
tk-bf19ff82cc3fb7362d1b9f268e090b7668d65239.tar.bz2
Fix bug [1001070]: make labels use -highlightbackground
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index dceb3a6..11dca9a 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -1054,6 +1054,54 @@ XFillRectangles(
/*
*----------------------------------------------------------------------
*
+ * TkMacOSXDrawSolidBorder --
+ *
+ * Draws a border rectangle of specified thickness inside the bounding
+ * rectangle of a Tk Window. The border rectangle can be inset within the
+ * bounding rectangle. For a highlight border the inset should be 0, but
+ * for a solid border around the actual window the inset should equal the
+ * thickness of the highlight border. The color of the border rectangle
+ * is the foreground color of the graphics context passed to the function.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a rectangular border inside the bounding rectangle of a window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void
+TkMacOSXDrawSolidBorder(
+ Tk_Window tkwin,
+ GC gc,
+ int inset,
+ int thickness)
+{
+ Drawable d = Tk_WindowId(tkwin);
+ TkMacOSXDrawingContext dc;
+ CGRect outerRect, innerRect;
+
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ outerRect = CGRectMake(Tk_X(tkwin), Tk_Y(tkwin),
+ Tk_Width(tkwin), Tk_Height(tkwin));
+ outerRect = CGRectInset(outerRect, inset, inset);
+ innerRect = CGRectInset(outerRect, thickness, thickness);
+ CGContextBeginPath(dc.context);
+ CGContextAddRect(dc.context, outerRect);
+ CGContextAddRect(dc.context, innerRect);
+ CGContextEOFillPath(dc.context);
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* XDrawArc --
*
* Draw an arc.