Tk Source Code

Check-in [acb0217c]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clean up setFrameSize.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cgimage_with_crossing
Files: files | file ages | folders
SHA3-256: acb0217c8e4165d87b11c4bbc49e150f654fdad89af0dada072a0b7d3c31b170
User & Date: culler 2024-06-19 14:30:26
Context
2024-06-19
18:27
A little more clean-up. check-in: a8794c73 user: culler tags: cgimage_with_crossing
14:30
Clean up setFrameSize. check-in: acb0217c user: culler tags: cgimage_with_crossing
2024-06-18
12:17
Remove inner loop in setFrameSize, tame the chaos with UpdateClipRgn, deal with the artifacts later. check-in: 50de0a3a user: culler tags: cgimage_with_crossing
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXWindowEvent.c.

1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
{
    [super setFrameSize: newsize];
    [self resetTkLayerBitmapContext];
    NSWindow *w = [self window];
    TkWindow *winPtr = TkMacOSXGetTkWindow(w);
    Tk_Window tkwin = (Tk_Window)winPtr;

    if (![self inLiveResize] &&
	[w respondsToSelector: @selector (tkLayoutChanged)]) {
	[(TKWindow *)w tkLayoutChanged];
	[self generateExposeEvents:[self bounds]];

    }

    if (winPtr) {
	unsigned int width = (unsigned int)newsize.width;
	unsigned int height=(unsigned int)newsize.height;
	void *oldArg;
    	Tk_RestrictProc *oldProc;

	/*







<
<
<
<
<
<
<







1034
1035
1036
1037
1038
1039
1040







1041
1042
1043
1044
1045
1046
1047
{
    [super setFrameSize: newsize];
    [self resetTkLayerBitmapContext];
    NSWindow *w = [self window];
    TkWindow *winPtr = TkMacOSXGetTkWindow(w);
    Tk_Window tkwin = (Tk_Window)winPtr;








    if (winPtr) {
	unsigned int width = (unsigned int)newsize.width;
	unsigned int height=(unsigned int)newsize.height;
	void *oldArg;
    	Tk_RestrictProc *oldProc;

	/*
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087

1088


1089
1090
1091
1092
1093
1094
1095
1096
1097


1098
1099
1100
1101
1102
1103
1104
	while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
    	Tk_RestrictEvents(oldProc, oldArg, &oldArg);

	/*
	 * Redraw the entire content view.
	 */

	if ([self inLiveResize]) {
	    [self viewDidChangeBackingProperties];
	    [self setNeedsDisplay:YES];
	} else {
	    if ([w respondsToSelector: @selector (tkLayoutChanged)]) {
		[(TKWindow *)w tkLayoutChanged];

	    }


	}

	/*
	 * Finally, unlock the main autoreleasePool.
	 */

	[NSApp _unlockAutoreleasePool];

    }


}

/*
 * Core method of this class: generates expose events for redrawing.  The
 * expose events are immediately removed from the Tcl event loop and processed.
 * This causes drawing procedures to be scheduled as idle events.  Then all
 * pending idle events are processed so the drawing will actually take place.







<
<
<
<
|
|
>
|
>
>









>
>







1068
1069
1070
1071
1072
1073
1074




1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
	while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
    	Tk_RestrictEvents(oldProc, oldArg, &oldArg);

	/*
	 * Redraw the entire content view.
	 */





	if ([w respondsToSelector: @selector (tkLayoutChanged)]) {
	    [(TKWindow *)w tkLayoutChanged];
	    [self generateExposeEvents:[self bounds]];
	}
	if ([self inLiveResize]) {
	    [self viewDidChangeBackingProperties];
	}

	/*
	 * Finally, unlock the main autoreleasePool.
	 */

	[NSApp _unlockAutoreleasePool];

    }
    [self setNeedsDisplay:YES];

}

/*
 * Core method of this class: generates expose events for redrawing.  The
 * expose events are immediately removed from the Tcl event loop and processed.
 * This causes drawing procedures to be scheduled as idle events.  Then all
 * pending idle events are processed so the drawing will actually take place.