SeeD,
There are two problems with your code.
First problem is that your window does not include the event loop.
This means that you are creating a window, and then your program ends. The window is then automatically destroyed.
Because PB is so lightening fast, you don't get to see a thing.
You need to put in a loop (doing the same thing over and over again) until the user closes the window.
like this:
Code: Select all
If OpenWindow(1, 100, 200, 300, 200, #PB_Window_SystemMenu, "abc")
If StartDrawing(WindowOutput())
BackColor (128, 8, 128) ; purple
Box(10,10,20,20)
StopDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
The second problem is that you are drawing onto an image. An image is an invisible thing that you use in the background, the user cannot see it.
If you want immediate results for your drawing, you should draw onto the window canvas direct (as above). If you do want to use a 'back' image first then you have to remember to draw it to the window when you've finished, otherwise it won't be seen.