home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls088.hpux.Z / tls088.hpux / lib / vtcl / tests / duplicate.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  762 b   |  32 lines

  1. # CVS $Id: duplicate.tcl,v 1.4 1995/04/28 11:40:46 zibi Exp $
  2. # This should barf gracefully when it comes across
  3. # a duplicate widget name
  4. # should get PASSED and PASSED from both these below...
  5. #
  6.  
  7. set as [VtOpen test]
  8.  
  9. set fn [VtStartForm $as.form ]
  10.  
  11. set pb [VtPushButton $fn.but1]
  12.  
  13. set err  [catch { set pb [VtPushButton $fn.but1] } msg]
  14.  
  15. if { $err } {
  16.    echo "PASSED - msg:  < $msg >"
  17. } else {
  18.    echo "ERROR: didn't get an error from a duplicate name "
  19. }
  20.  
  21. # allowDuplicateName should suppress error return...
  22. set err [catch { set pb [VtPushButton $fn.but1 -allowDuplicateName] } msg ] 
  23. if { ! $err } {
  24.    echo "PASSED : No error fm \"VtPushButton $fn.but1 -allowDuplicateName\""
  25. } else {
  26.    echo "ERROR: Allow duplicate is broken <$msg>"
  27. }
  28.  
  29. VtClose
  30. exit 0
  31.  
  32.