mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 10:35:17 +03:00
28 lines
679 B
Tcl
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
|