pantry/projects/tcl-lang.org/test.tcl
Andrew b815b97dcd
tcl-lang.org (#3362)
* new file:   projects/tcl-lang.org/package.yml
new file:   projects/tcl-lang.org/test.tcl
new file:   projects/tcl-lang.org/version.tcl

* tar -xJ

* args
2023-09-21 12:32:15 -04:00

28 lines
679 B
Tcl

# Check that Itcl and Itk load, and that we can define, instantiate,
# and query the properties of a widget.
# If anything errors, just exit
catch {
package require Itcl
package require Itk
# Define class
itcl::class TestClass {
inherit itk::Toplevel
constructor {args} {
itk_component add bye {
button $itk_interior.bye -text "Bye"
}
eval itk_initialize $args
}
}
# Create an instance
set testobj [TestClass .#auto]
# Check the widget has a bye component with text property "Bye"
if {[[$testobj component bye] cget -text]=="Bye"} {
puts "OK"
}
}
exit