Tk Source Code

Check-in [bf3a9da6]
Login

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

Overview
Comment:Provide a potential fallback for proc menubarheight.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: bf3a9da641f736cf9aecb5c8c247b49bd28cb6a2728deb8b85588eca49383f2c
User & Date: fvogel 2024-11-30 16:56:17
Context
2024-12-05
21:32
Make revised_text build when TK_CHECK_ALLOCS is defined. check-in: 3bd14b19 user: fvogel tags: revised_text, tip-466
2024-11-30
16:56
Provide a potential fallback for proc menubarheight. check-in: bf3a9da6 user: fvogel tags: revised_text, tip-466
16:56
merge trunk check-in: 0cfeb5b2 user: fvogel tags: revised_text, tip-466
16:55
Provide a potential fallback for proc menubarheight. check-in: e78b5c12 user: fvogel tags: trunk, main
Changes
Unified Diff Ignore Whitespace Patch
Changes to tests/constraints.tcl.
237
238
239
240
241
242
243





















244
245
246
247
248
249
250
		update idletasks ;# see a. above
		if {[tk windowingsystem] eq "win32"} {
			after $duration ;# see b. above
		}
	}
	namespace export controlPointerWarpTiming






















    }
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint
testConstraint notAqua [expr {[tk windowingsystem] ne "aqua"}]







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
		update idletasks ;# see a. above
		if {[tk windowingsystem] eq "win32"} {
			after $duration ;# see b. above
		}
	}
	namespace export controlPointerWarpTiming

	# On macOS windows are not allowed to overlap the menubar at the top of the
	# screen or the dock.  So tests which move a window and then check whether it
	# got moved to the requested location should use a y coordinate larger than the
	# height of the menubar (normally 23 pixels) and an x coordinate larger than the
	# width of the dock, if it happens to be on the left.
	# menubarheight deals with this issue but may not be available from the test
	# environment, therefore provide a fallback here
	if {[llength [info procs menubarheight]] == 0} {
	    if {[tk windowingsystem] ne "aqua"} {
		# Windows may overlap the menubar
		proc menubarheight {} {
		    return 0
		}
	    } else {
		# Windows may not overlap the menubar
		proc menubarheight {} {
		    return 30 ;  # arbitrary value known to be larger than the menubar height
		}
	    }
	    namespace export menubarheight
	}
    }
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint
testConstraint notAqua [expr {[tk windowingsystem] ne "aqua"}]