 ;******************************************************************** ;           Tutorials of How to use OS Functions in Blitz 2 ;                    Written by Roger Beausoleil ;                      vision_fx@citenet.net ;********************************************************************  ;******************************************************************** ; ;                              PART 3 ; ;               Just a bit more complex examples series ;           Please don't miss an example or you're gonna have ;                  hard time to understand all... ; ;********************************************************************  ;******************************************************************** ; ;                            Example 9 ; ;        Open a Window in the WorkBench... wait the user press ;    the CloseButton to close the Window or the Left Mouse Button ;    to print a text in the Window ( Clip ) as long as the user hold ;           it with the color chosen with a Gadtool Button ; ;********************************************************************  ; Don't forget this if you make an executable file ;WBStartup   ; All Newtypes Declarations €3.Library           *LayersBase €3.Library           *GfxBase €3.Library           *IntuiBase €3.Library           *GadToolBase €3._Window           *Windo €3.Region            *Reg €3.Rectangle          Rect €3.IntuiMessage      *Msg €3._Screen           *Scrn €3.Gadget            *GList €3.Gadget            *Gad €3.TextAttr          TopazFont €3.NewGadget         NewGad  TheGTList.l = 0  € WindoTags.TagItem(9)  ; Declares Constantes/Variables #MYWIN_WIDTH   = 400 #MYWIN_HEIGHT  = 200  ; Some constants For the position and size of our gadget #MYGAD_LEFT    = 10 #MYGAD_TOP     = 5 #MYGAD_WIDTH   = 100 #MYGAD_HEIGHT  = 16 #MYGAD_ID      = 0  ; The top gap required around the gadgets #MYTOPGAP      = 30  TheIDCMP.l = #IDCMP_CLOSEWINDOW|#IDCMP_MOUSEBUTTONS|#IDCMP_MOUSEMOVE|#BUTTONIDCMP|#IDCMP_REFRESHWINDOW|#IDCMP_GADGETUP    ; STATEMENTS AND FUNCTIONS € "Blitz2:OS_Functions/Part-3/Statements&Functions/RemoveClip.bb2" € "Blitz2:OS_Functions/Part-3/Statements&Functions/SetClip.bb2" € "Blitz2:OS_Functions/Part-3/Statements&Functions/HandleIDCMP.bb2" € "Blitz2:OS_Functions/Part-3/Statements&Functions/CreateWindow.bb2" € "Blitz2:OS_Functions/Part-3/Statements&Functions/SetupWindow.bb2"   ;Main     ; Open the Libraries...     *IntuiBase  = þÏ( ?INTUITION,0 )     €( *IntuiBase )         *GfxBase    = þÏ( ?GRAPHICS ,0 )         €( *GfxBase )             *LayersBase = þÏ( ?LAYERS,0 )             €( *LayersBase )                 *GadToolBase = þÏ( ?GTOOL,0 )                 €( *GadToolBase )                      ; Set the window... and, Further actions...                     €( setupWindow{} )                         handleIDCMP{}                         removeClip{}                     €À                      €( *Windo )                         ÿˆ( *Windo )                     €À                      €( TheGTList )                         ö( TheGTList )                     €À                      €( *VInfo )                         ö( *VInfo )                     €À                      €( *Scrn )                         ÿÒ "Workbench",*Scrn                     €À                      ; Close the opened library...                     þ»( *GadToolBase )                 €À              ; Close the opened library....             þ»( *LayersBase )             €À          ; Close the opened library...         þ»( *GfxBase )         €À      ; Close the opened library...     þ»( *IntuiBase )     €À  €   ; Strings of Characters SHOULD always go after everything... ; and SHOULD have an Even number of Characters. If It is not EVEN, ; just add ,0 or 0,0  €' GRAPHICS €%.b "graphics.library",0  LAYERS €%.b "layers.library",0  INTUITION €%.b "intuition.library",0,0  GTOOL €%.b "gadtools.library",0  €  