home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / ScriptX / Code Samples / untested / tcpip / browser / bug.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  734 b   |  32 lines  |  [TEXT/ttxt]

  1.  
  2. ---<<<
  3.  
  4. if not (isdefined tcpstream) do process (new loader) "loadable/web"
  5.  
  6. class HTMLClient ()
  7. instance variables
  8.     myDisplayer
  9. end
  10.  
  11. method init self {object HTMLClient} #rest args -> (
  12.     self.myDisplayer := new HTMLStream \
  13.                             startElement: (displayer element #rest args -> print #(@start, element, args)) \
  14.                             endElement: (displayer element -> print #(@end, element)) \
  15.                             putCharacter: (displayer ch -> print #(@ch, ch))
  16. )
  17.  
  18. function test -> (
  19.     local client := new HTMLClient
  20.     writestring client.myDisplayer "<HTML>foo</HTML>bar"
  21. )
  22.  
  23. function maketc -> (
  24.     local tc := new titlecontainer dir: theScriptDir path: "web.sxt"
  25.     append tc HTMLClient
  26.     tc.startupAction := (tc -> foreach tc load undefined)
  27.     close tc
  28. )
  29.  
  30.     
  31. --->>>
  32.