home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / develop / ezasm / scrwintags.s < prev    next >
Text File  |  1995-02-27  |  1KB  |  103 lines

  1.  
  2.  
  3. * Opens a window on a screen, and prints a message in it
  4.  
  5.  
  6.     LVER    intuition.library 36
  7.  
  8.  
  9. LONG    Screen Window IMClass MsgSave
  10. WORD    IMCode Height
  11.  
  12.  
  13.  
  14.  
  15.     a0 = _GfxBase
  16.     Height = 216(a0)    ;gb_NormalDisplayRows
  17.  
  18.     Screen = OpenScreenTagA( 0
  19.             SA_Width 640
  20.             SA_Height Height
  21.             SA_Depth 2
  22.             SA_DetailPen -1
  23.             SA_BlockPen -1
  24.             SA_Type $f
  25.             SA_Quiet 1
  26.             SA_DisplayID $8000
  27.             TAG_END )
  28.     beq    Exit
  29.  
  30.     Window = OpenWindowTagA( 0
  31.             WA_Left 20
  32.             WA_Top 20
  33.             WA_Width 300
  34.             WA_Height 75
  35.             WA_DetailPen -1
  36.             WA_BlockPen -1
  37.             WA_IDCMP $200
  38.             WA_Flags $2100f
  39.             WA_Title "My Window"
  40.             WA_CustomScreen Screen
  41.             WA_MaxWidth -1
  42.             WA_MaxHeight -1
  43.             TAG_END )
  44.     beq    Exit
  45.  
  46.     a0 = Window
  47.     Move( 50(a0) 20 30 )    ;wd_RPort
  48.  
  49.     a0 = Window
  50.     Text( 50(a0) "I hope you enjoy using EZAsm!" 29 )
  51.     
  52.  
  53. *   Check for messages..
  54.  
  55.  
  56. CheckMsg
  57.  
  58.     a1 = Window
  59.     WaitPort( 86(a1) )        ;wd_UserPort
  60.  
  61. GetMessage
  62.  
  63.     a1 = Window
  64.     MsgSave = GetMsg( 86(a1) )
  65.     beq    CheckMsg
  66.  
  67. *   Got something..
  68.  
  69.     a1 = MsgSave
  70.     IMClass = 20(a1)    ;im_Class
  71.     IMCode = 24(a1)        ;im_Code
  72.  
  73.     ReplyMsg( d0 )
  74.  
  75.     IMClass != 512 GetMessage    ;CLOSEWINDOW?
  76.  
  77.  
  78. Exit
  79.  
  80.     Window != 0 {
  81.  
  82.         Forbid()    ;( stop messages )
  83.  
  84. FreeLoop    a1 = Window
  85.         GetMsg( 86(a1) )
  86.  
  87.         d0 != 0 {
  88.             ReplyMsg( d0 )
  89.             bra    FreeLoop
  90.         }
  91.  
  92.         CloseWindow( Window )
  93.         Permit()
  94.     }
  95.  
  96.     Screen != 0 {
  97.         CloseScreen( Screen )
  98.     }
  99.  
  100.  
  101.     END
  102.  
  103.