home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / ITCL / _ITCL.TAR / usr / lib / itcl / demos / toasters / SmartToaster.tcl < prev    next >
Encoding:
Text File  |  1994-03-21  |  1.8 KB  |  41 lines

  1. # ----------------------------------------------------------------------
  2. #  PURPOSE:  Class definition for handling "smart" toasters via
  3. #            [incr Tcl].  A "smart" toaster is a toaster that
  4. #            automatically cleans itself when the crumb tray is full.
  5. #
  6. #   AUTHOR:  Michael J. McLennan       Phone: (610)712-2842
  7. #            AT&T Bell Laboratories   E-mail: michael.mclennan@att.com
  8. #
  9. #      RCS:  SmartToaster.tcl,v 1.1.1.1 1994/03/21 22:09:45 mmc Exp
  10. # ----------------------------------------------------------------------
  11. #               Copyright (c) 1993  AT&T Bell Laboratories
  12. # ======================================================================
  13. # Permission to use, copy, modify, and distribute this software and its
  14. # documentation for any purpose and without fee is hereby granted,
  15. # provided that the above copyright notice appear in all copies and that
  16. # both that the copyright notice and warranty disclaimer appear in
  17. # supporting documentation, and that the names of AT&T Bell Laboratories
  18. # any of their entities not be used in advertising or publicity
  19. # pertaining to distribution of the software without specific, written
  20. # prior permission.
  21. #
  22. # AT&T disclaims all warranties with regard to this software, including
  23. # all implied warranties of merchantability and fitness.  In no event
  24. # shall AT&T be liable for any special, indirect or consequential
  25. # damages or any damages whatsoever resulting from loss of use, data or
  26. # profits, whether in an action of contract, negligence or other
  27. # tortuous action, arising out of or in connection with the use or
  28. # performance of this software.
  29. # ======================================================================
  30.  
  31. itcl_class SmartToaster {
  32.     inherit Toaster
  33.  
  34.     method toast {nslices} {
  35.         if {$crumbs >= [expr $maxcrumbs-10]} {
  36.             clean
  37.         }
  38.         return [Toaster::toast $nslices]
  39.     }
  40. }
  41.