diff options
author | fvogel <fvogelnew1@free.fr> | 2020-08-30 12:11:57 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-08-30 12:11:57 (GMT) |
commit | ef2d1d2fbe725f5fbc265d5c6fcced9bbea48d45 (patch) | |
tree | b8a3fba7180a2e3b66e6703ac0d30d3f2a6afde4 /tests/ttk/scale.test | |
parent | df142b003e91df5e16b298ddb77c392b630fb52a (diff) | |
download | tk-ef2d1d2fbe725f5fbc265d5c6fcced9bbea48d45.zip tk-ef2d1d2fbe725f5fbc265d5c6fcced9bbea48d45.tar.gz tk-ef2d1d2fbe725f5fbc265d5c6fcced9bbea48d45.tar.bz2 |
Put the tests for ttk::scale in a specific scale.test file instead of hiding them in scrollbar.test
Diffstat (limited to 'tests/ttk/scale.test')
-rw-r--r-- | tests/ttk/scale.test | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/ttk/scale.test b/tests/ttk/scale.test new file mode 100644 index 0000000..ab3d19e --- /dev/null +++ b/tests/ttk/scale.test @@ -0,0 +1,52 @@ +package require Tk 8.5 +package require tcltest ; namespace import -force tcltest::* +loadTestedCommands + +test scale-1.0 "Self-destruction" -body { + trace variable v w { destroy .s ;# } + ttk::scale .s -variable v + pack .s ; update + .s set 1 ; update +} -returnCodes 1 -match glob -result "*" + +test scale-2.1 "-state option" -setup { + ttk::scale .s + set res "" +} -body { + # defaults + lappend res [.s instate disabled] [.s cget -state] + # set -state: instate returns accordingly + .s configure -state disabled + lappend res [.s instate disabled] [.s cget -state] + # back to normal + .s configure -state normal + lappend res [.s instate disabled] [.s cget -state] + # use state command: -state does NOT reflect it + .s state disabled + lappend res [.s instate disabled] [.s cget -state] + # further use state command + .s state readonly + lappend res [.s state] [.s cget -state] +} -cleanup { + destroy .s + unset -nocomplain res +} -result {0 normal 1 disabled 0 normal 1 normal {disabled readonly} normal} + +test scale-3.1 "style command" -body { + ttk::scale .wh ; # default is -orient horizontal + ttk::scale .wv -orient vertical + list [.wh cget -style] [.wh style] [winfo class .wh] \ + [.wv cget -style] [.wv style] [winfo class .wv] +} -cleanup { + destroy .wh .wv +} -result {{} Horizontal.TScale TScale {} Vertical.TScale TScale} +test scale-3.2 "style command" -body { + ttk::style configure customStyle.Vertical.TScale + ttk::scale .w -orient vertical -style customStyle.Vertical.TScale + list [.w cget -style] [.w style] [winfo class .w] +} -cleanup { + destroy .w +} -result {customStyle.Vertical.TScale Vertical.customStyle.Vertical.TScale TScale} + +tcltest::cleanupTests + |