📄 unixwm.test
字号:
tkwait visibility .t .t configure -width 180 -height 20 update set property [testprop [testwrapper .t] WM_NORMAL_HINTS] list [expr [lindex $property 5]] [expr [lindex $property 6]] \ [expr [lindex $property 7]] [expr [lindex $property 8]]} {180 20 180 20}test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} { catch {destroy .t} toplevel .t -width 80 -height 60 wm resizable .t 0 0 wm geometry .t +0+0 tkwait visibility .t .t configure -width 180 -height 50 frame .t.m -bd 2 -relief raised -width 100 -height 50 testmenubar window .t .t.m update .t configure -height 70 .t.m configure -height 30 list [update] [destroy .t]} {{} {}}test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unixOnly} { catch {destroy .t} toplevel .t -width 80 -height 60 wm grid .t 6 10 10 5 wm minsize .t 2 4 wm maxsize .t 30 40 wm geometry .t +0+0 tkwait visibility .t set property [testprop [testwrapper .t] WM_NORMAL_HINTS] list [expr [lindex $property 5]] [expr [lindex $property 6]] \ [expr [lindex $property 7]] [expr [lindex $property 8]] \ [expr [lindex $property 9]] [expr [lindex $property 10]]} {40 30 320 210 10 5}test unixWm-45.2 {UpdateSizeHints procedure} {unixOnly} { catch {destroy .t} toplevel .t -width 80 -height 60 wm minsize .t 30 40 wm maxsize .t 200 500 wm geometry .t +0+0 tkwait visibility .t set property [testprop [testwrapper .t] WM_NORMAL_HINTS] list [expr [lindex $property 5]] [expr [lindex $property 6]] \ [expr [lindex $property 7]] [expr [lindex $property 8]] \ [expr [lindex $property 9]] [expr [lindex $property 10]]} {30 40 200 500 1 1}test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} { catch {destroy .t} toplevel .t -width 80 -height 60 frame .t.menu -height 23 -width 50 testmenubar window .t .t.menu wm grid .t 6 10 10 5 wm minsize .t 2 4 wm maxsize .t 30 40 wm geometry .t +0+0 tkwait visibility .t set property [testprop [testwrapper .t] WM_NORMAL_HINTS] list [winfo height .t] \ [expr [lindex $property 5]] [expr [lindex $property 6]] \ [expr [lindex $property 7]] [expr [lindex $property 8]] \ [expr [lindex $property 9]] [expr [lindex $property 10]]} {60 40 53 320 233 10 5}test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} { catch {destroy .t} toplevel .t -width 80 -height 60 frame .t.menu -height 23 -width 50 testmenubar window .t .t.menu wm resizable .t 0 0 wm geometry .t +0+0 tkwait visibility .t set property [testprop [testwrapper .t] WM_NORMAL_HINTS] list [winfo height .t] \ [expr [lindex $property 5]] [expr [lindex $property 6]] \ [expr [lindex $property 7]] [expr [lindex $property 8]] \ [expr [lindex $property 9]] [expr [lindex $property 10]]} {60 80 83 80 83 1 1}# I don't know how to test WaitForConfigureNotify.test unixWm-46.1 {WaitForEvent procedure, use of modal timeout} { catch {destroy .t} toplevel .t -width 200 -height 200 wm geom .t +0+0 update wm iconify .t set x no after 0 {set x yes} wm deiconify .t set result $x update list $result $x} {no yes}test unixWm-47.1 {WaitRestrictProc procedure} { catch {destroy .t} toplevel .t -width 300 -height 200 frame .t.f -bd 2 -relief raised place .t.f -x 20 -y 30 -width 100 -height 20 wm geometry .t +0+0 tkwait visibility .t set result {} bind .t.f <Configure> {lappend result {configure on .t.f}} bind .t <Map> {lappend result {map on .t}} bind .t <Unmap> {lappend result {unmap on .t}; bind .t <Unmap> {}} bind .t <Button> {lappend result {button %b on .t}} event generate .t.f <Configure> -when tail event generate .t <Configure> -when tail event generate .t <Button> -button 3 -when tail event generate .t <Map> -when tail lappend result iconify wm iconify .t lappend result done update set result} {iconify {unmap on .t} done {configure on .t.f} {button 3 on .t} {map on .t}}# I don't know how to test WaitTimeoutProc, WaitForMapNotify, or UpdateHints.catch {destroy .t}toplevel .t -width 300 -height 200wm geometry .t +0+0tkwait visibility .ttest unixWm-48.1 {ParseGeometry procedure} { wm geometry .t =100x120 update list [winfo width .t] [winfo height .t]} {100 120}test unixWm-48.2 {ParseGeometry procedure} { list [catch {wm geometry .t =10zx120} msg] $msg} {1 {bad geometry specifier "=10zx120"}}test unixWm-48.3 {ParseGeometry procedure} { list [catch {wm geometry .t x120} msg] $msg} {1 {bad geometry specifier "x120"}}test unixWm-48.4 {ParseGeometry procedure} { list [catch {wm geometry .t =100x120a} msg] $msg} {1 {bad geometry specifier "=100x120a"}}test unixWm-48.5 {ParseGeometry procedure} { list [catch {wm geometry .t z} msg] $msg} {1 {bad geometry specifier "z"}}test unixWm-48.6 {ParseGeometry procedure} { list [catch {wm geometry .t +20&} msg] $msg} {1 {bad geometry specifier "+20&"}}test unixWm-48.7 {ParseGeometry procedure} { list [catch {wm geometry .t +-} msg] $msg} {1 {bad geometry specifier "+-"}}test unixWm-48.8 {ParseGeometry procedure} { list [catch {wm geometry .t +20a} msg] $msg} {1 {bad geometry specifier "+20a"}}test unixWm-48.9 {ParseGeometry procedure} { list [catch {wm geometry .t +20-} msg] $msg} {1 {bad geometry specifier "+20-"}}test unixWm-48.10 {ParseGeometry procedure} { list [catch {wm geometry .t +20+10z} msg] $msg} {1 {bad geometry specifier "+20+10z"}}test unixWm-48.11 {ParseGeometry procedure} { catch {wm geometry .t +-10+20}} {0}test unixWm-48.12 {ParseGeometry procedure} { catch {wm geometry .t +30+-10}} {0}test unixWm-48.13 {ParseGeometry procedure, resize causes window to move} { catch {destroy .t} toplevel .t -width 200 -height 200 wm geom .t +0+0 update wm geom .t -0-0 update set x [winfo x .t] set y [winfo y .t] wm geometry .t 150x300 update list [expr [winfo x .t] - $x] [expr [winfo y .t] - $y] \ [winfo width .t] [winfo height .t]} {50 -100 150 300}test unixWm-49.1 {Tk_GetRootCoords procedure} { catch {destroy .t} toplevel .t -width 300 -height 200 frame .t.f -width 150 -height 100 -bd 2 -relief raised place .t.f -x 150 -y 120 frame .t.f.f -width 20 -height 20 -bd 2 -relief raised place .t.f.f -x 10 -y 20 wm overrideredirect .t 1 wm geometry .t +40+50 tkwait visibility .t list [winfo rootx .t.f.f] [winfo rooty .t.f.f]} {202 192}test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unixOnly} { catch {destroy .t} toplevel .t -width 300 -height 200 -bd 2 -relief raised wm geom .t +0+0 update set x [winfo rootx .t] set y [winfo rooty .t] frame .t.m -bd 2 -relief raised -width 100 -height 30 frame .t.m.f -width 20 -height 10 -bd 2 -relief raised place .t.m.f -x 50 -y 5 frame .t.f -width 20 -height 30 -bd 2 -relief raised place .t.f -x 10 -y 30 testmenubar window .t .t.m update list [expr [winfo rootx .t.m.f] - $x] [expr [winfo rooty .t.m.f] - $y] \ [expr [winfo rootx .t.f] - $x] [expr [winfo rooty .t.f] - $y] } {52 7 12 62}foreach w [winfo children .] { catch {destroy $w}}wm iconify .test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords} { eval destroy [winfo children .] toplevel .t -width 300 -height 400 -bg green wm geom .t +40+0 tkwait visibility .t toplevel .t2 -width 100 -height 80 -bg red wm geom .t2 +140+200 tkwait visibility .t2 raise .t2 set x [winfo rootx .t] set y [winfo rooty .t] list [winfo containing [expr $x - 30] [expr $y + 250]] \ [winfo containing [expr $x - 1] [expr $y + 250]] \ [winfo containing $x [expr $y + 250]] \ [winfo containing [expr $x + 99] [expr $y + 250]] \ [winfo containing [expr $x + 100] [expr $y + 250]] \ [winfo containing [expr $x + 199] [expr $y + 250]] \ [winfo containing [expr $x + 200] [expr $y + 250]] \ [winfo containing [expr $x + 220] [expr $y + 250]]} {{} {} .t {} .t2 .t2 {} .t}test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and overrideredirect} { eval destroy [winfo children .] toplevel .t -width 300 -height 400 -bg yellow wm geom .t +0+50 tkwait visibility .t toplevel .t2 -width 100 -height 80 -bg blue wm overrideredirect .t2 1 wm geom .t2 +100+200 tkwait visibility .t2 raise .t2 set x [winfo rootx .t] set y [winfo rooty .t] set y2 [winfo rooty .t2] list [winfo containing [expr $x +150] 10] \ [winfo containing [expr $x +150] [expr $y - 1]] \ [winfo containing [expr $x +150] $y] \ [winfo containing [expr $x +150] [expr $y2 - 1]] \ [winfo containing [expr $x +150] $y2] \ [winfo containing [expr $x +150] [expr $y2 + 79]] \ [winfo containing [expr $x +150] [expr $y2 + 80]] \ [winfo containing [expr $x +150] [expr $y + 450]]} {{} {} .t .t .t2 .t2 .t {}}test unixWm-50.3 {Tk_CoordsToWindow procedure, finding a toplevel with embedding} { eval destroy [winfo children .] toplevel .t -width 300 -height 400 -bg blue wm geom .t +0+50 frame .t.f -container 1 place .t.f -x 150 -y 50 tkwait visibility .t.f setupbg dobg " wm withdraw . toplevel .x -width 100 -height 80 -use [winfo id .t.f] -bg yellow tkwait visibility .x" set result [dobg { set x [winfo rootx .x] set y [winfo rooty .x] list [winfo containing [expr $x - 1] [expr $y + 50]] \ [winfo containing $x [expr $y +50]] }] set x [winfo rootx .t] set y [winfo rooty .t] lappend result [winfo containing [expr $x + 200] [expr $y + 49]] \ [winfo containing [expr $x + 200] [expr $y +50]]} {{} .x .t .t.f}cleanupbgtest unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} { catch {destroy .t} catch {interp delete slave} toplevel .t -width 200 -height 200 -bg green wm geometry .t +0+0 tkwait visibility .t interp create slave load {} tk slave slave eval {wm geometry . 200x200+0+0; tkwait visibility .} set result [list [winfo containing 100 100] \ [slave eval {winfo containing 100 100}]] interp delete slave set result} {{} .}test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unixOnly} { eval destroy [winfo children .] toplevel .t -width 300 -height 400 -bd 2 -relief raised frame .t.f -width 150 -height 120 -bg green place .t.f -x 10 -y 150 wm geom .t +0+50 frame .t.menu -width 100 -height 30 -bd 2 -relief raised frame .t.menu.f -width 40 -height 20 -bg purple place .t.menu.f -x 30 -y 10 testmenubar window .t .t.menu tkwait visibility .t.menu update set x [winfo rootx .t] set y [winfo rooty .t] list [winfo containing $x [expr $y - 31]] \ [winfo containing $x [expr $y - 30]] \ [winfo containing [expr $x + 50] [expr $y - 19]] \ [winfo containing [expr $x + 50] [expr $y - 18]] \ [winfo containing [expr $x + 50] $y] \ [winfo containing [expr $x + 11] [expr $y + 152]] \ [winfo containing [expr $x + 12] [expr $y + 152]]} {{} .t.menu .t.menu .t.menu.f .t .t .t.f}test unixWm-50.6 {Tk_CoordsToWindow procedure, embedding within one app.} { eval destroy [winfo children .] toplevel .t -width 300 -height 400 -bg orange wm geom .t +0+50 frame .t.f -container 1 place .t.f -x 150 -y 50 tkwait visibility .t.f toplevel .t2 -width 100 -height 80 -bg green -use [winfo id .t.f] tkwait visibility .t2 update set x [winfo rootx .t] set y [winfo rooty .t] list [winfo containing [expr $x +149] [expr $y + 80]] \ [winfo containing [expr $x +150] [expr $y +80]] \ [winfo containing [expr $x +249] [expr $y +80]] \ [winfo containing [expr $x +250] [expr $y +80]]} {.t .t2 .t2 .t}test unixWm-50.7 {Tk_CoordsToWindow procedure, more basics} { catch {destroy .t} toplevel .t -width 300 -height 400 -bg green wm geom .t +0+0 frame .t.f -width 100 -height 200 -bd 2 -relief raised place .t.f -x 100 -y 100 frame .t.f.f -width 100 -height 200 -bd 2 -relief raised place .t.f.f -x 0 -y 100 tkwait visibility .t.f.f set x [expr [winfo rootx .t] + 150] set y [winfo rooty .t] list [winfo containing $x [expr $y + 50]] \ [winfo containing $x [expr $y + 150]] \ [winfo containing $x [expr $y + 250]] \ [winfo containing $x [expr $y + 350]] \ [winfo containing $x [expr $y + 450]]} {.t .t.f .t.f.f .t {}}test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} { catch {destroy .t} toplevel .t -width 400 -height 300 -bg green wm geom .t +0+0 frame .t.f -width 200 -height 100 -bd 2 -relief raised place .t.f -x 100 -y 100 frame .t.f.f -width 200 -height 100 -bd 2 -relief raised place .t.f.f -x 100 -y 0 update set x [winfo rooty .t] set y [expr [winfo rooty .t] + 150] list [winfo containing [expr $x + 50] $y] \ [winfo containing [expr $x + 150] $y] \ [winfo containing [expr $x + 250] $y] \ [winfo containing [expr $x + 350] $y] \ [winfo containing [expr $x + 450] $y]} {.t .t.f .t.f.f .t {}}test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} { catch {destroy .t} catch {destroy .t2} sleep 500 ;# Give window manager time to catch up. toplevel .t -width 200 -height 200 -bg green wm geometry .t +0+0 tkwait visibility .t toplevel .t2 -width 200 -height 200 -bg red wm geometry .t2 +0+0 tkwait visibilit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -