📄 textwind.test
字号:
list [winfo exists .f] [winfo geom .f] [.t index .f]} {1 10x20+40+5 1.5}test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.5 -create { error "couldn't create window" } set msg xyzzy update list $msg [.t bbox 1.5]} {{{couldn't create window}} {40 11 0 0}}test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.5 -create { concat gorp } set msg xyzzy update list $msg [.t bbox 1.5]} {{{bad window path name "gorp"}} {40 11 0 0}}test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.5 -create { frame .t.f frame .t.f.f -width 10 -height 20 -bg $color } set msg xyzzy update list $msg [.t bbox 1.5] [winfo exists .t.f.f]} {{{can't embed .t.f.f relative to .t}} {40 11 0 0} 1}catch {destroy .t.f}test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.5 -create { concat .t } set msg xyzzy update list $msg [.t bbox 1.5]} {{{can't embed .t relative to .t}} {40 11 0 0}}test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.5 -create { toplevel .t2 -width 100 -height 150 wm geom .t2 +0+0 concat .t2 } set msg xyzzy update list $msg [.t bbox 1.5]} {{{can't embed .t2 relative to .t}} {40 11 0 0}}test textWind-10.7 {EmbWinLayoutProc procedure, steal window from self} { .t delete 1.0 end .t insert 1.0 ABCDEFGHIJKLMNOP button .t.b -text "Hello!" .t window create 1.5 -window .t.b update .t window create 1.3 -create {concat .t.b} update .t index .t.b} {1.3}catch {destroy .t2}test textWind-10.8 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 125 -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f list [.t bbox .f] [.t bbox 1.13]} {{89 5 126 20} {5 25 7 13}}test textWind-10.9 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 126 -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f update list [.t bbox .f] [.t bbox 1.13]} {{89 5 126 20} {5 25 7 13}}test textWind-10.10 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 127 -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f update list [.t bbox .f] [.t bbox 1.13]} {{5 18 127 20} {132 21 7 13}}test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 130 -height 20 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f update list [.t bbox .f] [.t bbox 1.13]} {{89 5 126 20} {}}test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 130 -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f update list [.t bbox .f] [.t bbox 1.13]} {{89 5 126 78} {}}test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised .t window create 1.12 -window .f update list [.t bbox .f] [.t bbox 1.13]} {{5 18 210 65} {}}test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} { .t delete 1.0 end .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f update winfo geom .f} {30x20+119+55}place forget .tpack .ttest textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} { .t delete 1.0 end .t insert 1.0 "Some sample text" pack forget .t place .t -x 30 -y 50 frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f update winfo geom .t.f} {30x20+89+5}place forget .tpack .ttest textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f update bind .f <Configure> {set x ".f configured"} set x {no configures} .t delete 1.0 .t insert 1.0 "X" update set x} {no configures}test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} { .t delete 1.0 end .t insert 1.0 "xyzzy\nFirst window here: " .t configure -wrap none frame .f -width 30 -height 20 -bg $color .t window create end -window .f .t insert end " and second here: " frame .f2 -width 40 -height 10 -bg $color .t window create end -window .f2 .t insert end " with junk after it." .t xview moveto 0 .t xview scroll 5 units update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2]} {1 30x20+103+18 {103 18 30 20} 0}test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} { .t delete 1.0 end .t insert 1.0 "xyzzy\nFirst window here: " .t configure -wrap none frame .f -width 30 -height 20 -bg $color .t window create end -window .f .t insert end " and second here: " frame .f2 -width 40 -height 10 -bg $color .t window create end -window .f2 .t insert end " with junk after it." update .t xview moveto 0 .t xview scroll 25 units update list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2]} {0 1 40x10+119+23 {119 23 40 10}}.t configure -wrap chartest textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f bind .f <Map> {lappend x mapped} bind .f <Unmap> {lappend x unmapped} set x created update lappend x modified .t delete 1.0 update lappend x replaced .t window configure .f -window {} .t delete 1.1 .t window create 1.4 -window .f update lappend x off-screen .t configure -wrap none .t insert 1.0 "Enough text to make the line run off-screen" update set x} {created mapped modified replaced unmapped mapped off-screen unmapped}test textWind-13.1 {EmbWinBboxProc procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 update list [winfo geom .f] [.t bbox .f]} {5x5+21+6 {21 6 5 5}}test textWind-13.2 {EmbWinBboxProc procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 update list [winfo geom .f] [.t bbox .f]} {5x5+21+9 {21 9 5 5}}test textWind-13.3 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 update list [winfo geom .f] [.t bbox .f]} {5x5+21+10 {21 10 5 5}}test textWind-13.4 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 update list [winfo geom .f] [.t bbox .f]} {5x5+21+12 {21 12 5 5}}test textWind-13.5 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1 update list [winfo geom .f] [.t bbox .f]} {5x11+21+6 {21 6 5 11}}test textWind-13.6 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1 update list [winfo geom .f] [.t bbox .f]} {5x11+21+6 {21 6 5 11}}test textWind-13.7 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1 update list [winfo geom .f] [.t bbox .f]} {5x9+21+6 {21 6 5 9}}test textWind-13.8 {EmbWinBboxProc procedure} {fonts} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1 update list [winfo geom .f] [.t bbox .f]} {5x11+21+6 {21 6 5 11}}test textWind-13.9 {EmbWinBboxProc procedure, spacing options} { .t configure -spacing1 5 -spacing3 2 .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 5 -height 5 -bg $color .t window create 1.2 -window .f -align center -padx 2 -pady 1 update list [winfo geom .f] [.t bbox .f]} {5x5+21+14 {21 14 5 5}}.t configure -spacing1 0 -spacing2 0 -spacing3 0test textWind-14.1 {EmbWinDelayedUnmap procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f update bind .f <Unmap> {lappend x unmapped} set x modified .t insert 1.0 x lappend x removed .t window configure .f -window {} lappend x updated update set x} {modified removed unmapped updated}catch {destroy .f}test textWind-14.2 {EmbWinDelayedUnmap procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f update bind .f <Unmap> {lappend x unmapped} set x modified .t insert 1.0 x lappend x deleted .t delete .f lappend x updated update set x} {modified deleted updated}test textWind-14.3 {EmbWinDelayedUnmap procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .f -width 30 -height 20 -bg $color .t window create 1.2 -window .f update .t yview 2.0 set result [winfo ismapped .f] update list $result [winfo ismapped .f]} {1 0}test textWind-14.4 {EmbWinDelayedUnmap procedure} { .t delete 1.0 end .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9" frame .t.f -width 30 -height 20 -bg $color .t window create 1.2 -window .t.f update .t yview 2.0 set result [winfo ismapped .t.f] update list $result [winfo ismapped .t.f]} {1 0}catch {destroy .t.f}catch {destroy .f}test textWind-15.1 {TkTextWindowIndex procedure} { list [catch {.t index .foo} msg] $msg} {1 {bad text index ".foo"}}test textWind-15.2 {TkTextWindowIndex procedure} {fonts} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f .t tag add a 1.1 .t tag add a 1.3 list [.t index .f] [.t bbox 1.7]} {1.6 {77 8 7 13}}test textWind-16.1 {EmbWinTextStructureProc procedure} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f update pack forget .t update winfo ismapped .f} 0pack .ttest textWind-16.2 {EmbWinTextStructureProc procedure} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f update set result {} lappend result [winfo geom .f] [.t bbox .f] frame .f2 -width 150 -height 30 -bd 2 -relief raised pack .f2 -before .t update lappend result [winfo geom .f] [.t bbox .f]} {30x20+47+5 {47 5 30 20} 30x20+47+35 {47 5 30 20}}catch {destroy .f2}test textWind-16.3 {EmbWinTextStructureProc procedure} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" .t window create 1.6 update pack forget .t update} {}pack .ttest textWind-16.4 {EmbWinTextStructureProc procedure} { .t configure -wrap none .t delete 1.0 end .t insert 1.0 "Some sample text" frame .t.f -width 30 -height 20 -bg $color .t window create 1.6 -window .t.f update pack forget .t update list [winfo ismapped .t.f] [.t bbox .t.f]} {1 {47 5 30 20}}pack .tcatch {destroy .t}option clear
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -