In the code below, why is the red background not filling the whole window, as they have the same size (WinW and WinH) ?
Code: Select all
EnableExplicit
Define.i BtnOk,Event,F,ImCre,ImGad,Quit,Win,WinH,WinW
F=LoadFont(#PB_Any,"Courier New",32)
WinW=800
WinH=300
Win.i=OpenWindow(#PB_Any,0,0,WinW,WinH,"ERROR",#PB_Window_ScreenCentered)
ImCre.i=CreateImage(#PB_Any,WinW,WinH)
ImGad.i=ImageGadget(#PB_Any,0,0,WinW,WinH,ImageID(ImCre))
StartDrawing(ImageOutput(ImCre))
DrawingMode(#PB_2DDrawing_Transparent)
Box(0,0,WinW,WinH,#Red)
DrawingFont(FontID(F))
DrawText(40,50,"!ERROR=47",#Yellow)
StopDrawing()
SetGadgetState(ImGad,ImageID(ImCre))
BtnOk.i=ButtonGadget(#PB_Any,40,255,80,25,"OK",#PB_Button_Default)
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Quit=#True
Case #PB_Event_Gadget
Select EventGadget()
Case BtnOk
Quit=#True
EndSelect
EndSelect
Until Quit



