No big deal, but here's my first go at a window skeleton program.
Code: Select all
; skeleton window
EnableExplicit
Define.l Event,wW,wH,run,textW
Define.s a$
#w1 = 1
;(Note: Window Flags: #SysMenu = $80000  #Max = $10000  #Min = $20000   #Size = $40000)
#Center = 1
#Full = $F0000      ;#SysMenu|#Max|#Min|#Size
#Fixed = $A0000     ;#SysMenu|#Min
wW = 500
wH = 300
run = #True
OpenWindow(#w1, 0, 0, wW, wH, "PB Skeleton Window",#Fixed|#Center)
SetWindowColor(#w1, RGB(0,100,120)) 
#B_Exit = 1
ButtonGadget(#B_Exit, (wW-70)/2, 210, 70, 25, "Exit",#BS_FLAT)
; Display some text ..
LoadFont(1, "Arial", 20, #PB_Font_Italic|#PB_Font_Bold)
StartDrawing(WindowOutput(#w1))
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor(RGB(130,150,230))
DrawingFont(FontID(1)) 
a$ = "Welcome to PureBasic"
textW = TextWidth(a$)
DrawText((wW-textw)/2,50,a$)
StopDrawing()
Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
      run = #False
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #B_Exit
          run = #False
      EndSelect
  EndSelect
Until run = #False
End
best wishes,
Graham







