home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / FORTH / WIMPFO.ZIP / !WimpForth / winsee < prev    next >
Text File  |  1996-03-19  |  1KB  |  57 lines

  1. \ Decompile into a window
  2.  
  3. :class see-window <super text-window <classpointer
  4. int tosee
  5. :m ClassInit: { cfa \ $title -- }
  6.      30 LocalAlloc: $title
  7.      cfa to tosee
  8.      s" See: " $title place
  9.      cfa >name nfa-count $title +place
  10.      $title 50 0 ClassInit: super ;m
  11. :m On_Init:    ( -- )
  12.      1 to rows 0 to xcur 0 to ycur
  13.      here 5000 + to &thescreen
  14.      &thescreen cols blank
  15.      outwindow >r  self to outwindow
  16.      tosee (see) r> to outwindow
  17.      &thescreen rows cols * dup>r
  18.      allocate abort" Not enough Heap!"
  19.      dup to &thescreen r> 2dup + to &endscreen move
  20.      cols 16* rows 1+ 5 lshift 2dup
  21.      SetSize SetWaSize ;m
  22. :m PutText:   ( ad n -- )
  23.      dup>r &thescreen ycur cols * xcur + + swap move
  24.      r> +to xcur ;m
  25. :m PutCR:     ( -- )
  26.      &thescreen rows cols * + cols blank
  27.      rows to ycur
  28.      1 +to rows 0 to xcur ;m
  29. ;class
  30.  
  31. also classes
  32. : wsee ( -<name>- ptr )
  33.     ' heap> see-window ;
  34. previous
  35.  
  36. \   Usage:
  37.  
  38. wsee .s value sp
  39.  
  40. popup spo "See"
  41.   menuitem "Believe" beep ;
  42.   menuseparator
  43.   menuitem "Quit" Stop: sp ; 
  44. spo &Popup: sp !
  45.  
  46. \ 400 400 start: sp
  47.  
  48. also classes
  49.  
  50. wsee heap> value hp
  51. \ 400 400 start: hp
  52.  
  53. : .w
  54.     windows-link
  55.     begin ?dup
  56.     while cr dup h. dup cell+ @ dup h. Print: [[ ]] @
  57.     repeat ;