Import Tix 8.4.3.5 (as of svn r86089)

This commit is contained in:
Zachary Ware
2017-05-22 16:16:49 -05:00
parent d239d63057
commit 80ba28babb
769 changed files with 136423 additions and 0 deletions

109
tests/general/optmenu.tcl Normal file
View File

@@ -0,0 +1,109 @@
# -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: optmenu.tcl,v 1.2 2002/11/13 21:12:18 idiscovery Exp $
#
proc About {} {
return "Testing Option Menu widget"
}
proc Test {} {
tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
-disablecallback 1 \
-options {
label.width 19
label.anchor e
menubutton.width 15
}
pack .p
.p add command text -label "Plain Text"
.p add command post -label "PostScript"
.p add command format -label "Formatted Text"
.p add command html -label "HTML"
.p add separator sep
.p add command tex -label "LaTeX"
.p add command rtf -label "Rich Text Format"
update
foreach ent [.p entries] {
test {.p delete $ent}
}
Assert {[.p subwidget menubutton cget -text] == {}}
test {destroy .p}
# Testing deleting "sep" at the end
#
tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
-disablecallback 1 \
-options {
label.width 19
label.anchor e
menubutton.width 15
}
pack .p
.p add command text -label "Plain Text"
.p add command post -label "PostScript"
.p add command format -label "Formatted Text"
.p add command html -label "HTML"
.p add separator sep
.p add command tex -label "LaTeX"
.p add command rtf -label "Rich Text Format"
test {.p delete text}
test {.p delete post}
test {.p delete html}
test {.p delete format}
test {.p delete tex}
test {.p delete rtf}
test {.p delete sep}
Assert {[.p subwidget menubutton cget -text] == {}}
test {destroy .p}
# Testing deleting "sep" as the second-last one
#
tixOptionMenu .p -label "From File Format : " -command "selectproc input" \
-disablecallback 1 \
-options {
label.width 19
label.anchor e
menubutton.width 15
}
pack .p
.p add command text -label "Plain Text"
.p add command post -label "PostScript"
.p add command format -label "Formatted Text"
.p add command html -label "HTML"
.p add separator sep
.p add command tex -label "LaTeX"
.p add command rtf -label "Rich Text Format"
test {.p delete text}
global .p
Assert {[info exists .p(text,type)] == 0}
Assert {[info exists .p(text,name)] == 0}
Assert {[info exists .p(text,label)] == 0}
test {.p delete post}
test {.p delete html}
test {.p delete format}
test {.p delete tex}
Assert {[.p cget -value] == "rtf"}
test {.p delete sep}
Assert {[.p cget -value] == "rtf"}
test {.p delete rtf}
Assert {[.p subwidget menubutton cget -text] == {}}
test {destroy .p}
}