summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXRegion.c
diff options
context:
space:
mode:
authorculler <culler>2021-04-20 21:44:01 (GMT)
committerculler <culler>2021-04-20 21:44:01 (GMT)
commit423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc (patch)
treede072e1c17cdabcdeaed6d5ebe4995161c0e5209 /macosx/tkMacOSXRegion.c
parent269976f190336ef9eb04dea3a593de5c67b807e4 (diff)
downloadtk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.zip
tk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.tar.gz
tk-423b0ae36f245b340d14ab4ed3ec0fdf15dc71cc.tar.bz2
fix [cde766f911]: scrollbars do not update correctly for treeview widgets.
Diffstat (limited to 'macosx/tkMacOSXRegion.c')
-rw-r--r--macosx/tkMacOSXRegion.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c
index 6c70a63..3c168f1 100644
--- a/macosx/tkMacOSXRegion.c
+++ b/macosx/tkMacOSXRegion.c
@@ -555,6 +555,55 @@ TkMacOSHIShapeUnion(
return result;
}
+static OSStatus
+rectCounter(
+ int msg,
+ TCL_UNUSED(HIShapeRef),
+ const CGRect *rect,
+ void *ref)
+{
+ int *count = (int *)ref;
+ (*count)++;
+ return noErr;
+}
+
+static OSStatus
+rectPrinter(
+ int msg,
+ TCL_UNUSED(HIShapeRef),
+ const CGRect *rect,
+ void *ref)
+{
+ if (rect) {
+ printf(" %s\n", NSStringFromRect(*rect).UTF8String);
+ }
+ return noErr;
+}
+
+int
+TkMacOSXCountRectsInRegion(
+ HIShapeRef shape)
+{
+ int rect_count = 0;
+ if (!HIShapeIsEmpty(shape)) {
+ ChkErr(HIShapeEnumerate, shape,
+ kHIShapeParseFromBottom|kHIShapeParseFromLeft,
+ rectCounter, &rect_count);
+ }
+ return rect_count;
+}
+
+void
+TkMacOSXPrintRectsInRegion(
+ HIShapeRef shape)
+{
+ if (!HIShapeIsEmpty(shape)) {
+ ChkErr(HIShapeEnumerate, shape,
+ kHIShapeParseFromBottom|kHIShapeParseFromLeft,
+ rectPrinter, NULL);
+ }
+}
+
/*
* Local Variables:
* mode: objc