diff options
author | mdejong <mdejong> | 2006-12-17 00:43:05 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2006-12-17 00:43:05 (GMT) |
commit | d778dce1486c69cefb53c8d7e4408046cfba3017 (patch) | |
tree | 5cd38cfa91b99fd3cfd7dd620f620aa0c0197ee3 /tests | |
parent | 9203d717715a5ba3f49028f2c0a713df20d02b84 (diff) | |
download | tk-d778dce1486c69cefb53c8d7e4408046cfba3017.zip tk-d778dce1486c69cefb53c8d7e4408046cfba3017.tar.gz tk-d778dce1486c69cefb53c8d7e4408046cfba3017.tar.bz2 |
* doc/cursors.n: Mention "none" in supported
cursor list. Fix comment that incorrectly
claims that the Win32 "no" cursor hides
the cursor.
* tests/cursor.test: Test "none" cursor.
* unix/tkUnixCursor.c (CreateCursorFromTableOrFile,
TkGetCursorByName): Define a table of Tk cursors
that is searched in addition to the X cursor
table. A Tk cursor is loaded from a data string
and works with the same options as the built
in X cursors. This code makes it possible to
use "none" as a cursor name under Unix.
* win/rc/cursor9a.cur: Added none Win32 cursor.
* win/rc/tk_base.rc: Define a built-in Win32
cursor named "none".
[Patch 1615427]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cursor.test | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/tests/cursor.test b/tests/cursor.test index ebe58e1..d5dabcf 100644 --- a/tests/cursor.test +++ b/tests/cursor.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: cursor.test,v 1.15 2004/12/07 10:07:59 dkf Exp $ +# RCS: @(#) $Id: cursor.test,v 1.16 2006/12/17 00:43:06 mdejong Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -228,6 +228,61 @@ foreach {testName cursor} { } -result {} } +# Test cursor named "none", it is not defined in +# the X cursor table. It is defined in a Tk specific +# table of named cursors and should be available on +# all platforms. + +test cursor-6.80 {} -setup { + button .b -text CButton +} -body { + .b configure -cursor none + .b cget -cursor +} -cleanup { + destroy .b +} -result none + +test cursor-6.81 {} -setup { + button .b -text CButton +} -body { + .b configure -cursor none + .b configure -cursor {} + .b cget -cursor +} -cleanup { + destroy .b +} -result {} + +test cursor-6.82 {} -setup { + button .b -text CButton +} -body { + .b configure -cursor none + .b configure -cursor {} + .b configure -cursor none + .b cget -cursor +} -cleanup { + destroy .b +} -result none + +test cursor-6.83 {} -setup { + button .b -text CButton +} -body { + # Setting fg and bg does nothing for the none cursor + # because it displays no fg or bg pixels. + set results [list] + .b configure -cursor none + lappend results [.b cget -cursor] + .b configure -cursor {none blue} + lappend results [.b cget -cursor] + .b configure -cursor {none blue green} + lappend results [.b cget -cursor] + .b configure -cursor {} + lappend results [.b cget -cursor] + set results +} -cleanup { + destroy .b + unset results +} -result {none {none blue} {none blue green} {}} + # ------------------------------------------------------------------------- # Check the Windows specific cursors |