This is using the 5.70 IDE (I can't install 5.73) in Linux
I'm writing a project which already has a few thousand lines of code which neither need a window nor an event loop - reading in and checking data.
Now I open a window (no event loop just yet), but as soon as I try to create a gadget the window closes. The minimal code snippet below behaves like this. I have tried opening an old working project, creating a new file (without adding it to the project) and pasting this code in and it does it there too.
Code: Select all
OpenWindow(100, 10, 50, 500, 500, "Heading",
#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_TitleBar)
;window colour
SetWindowColor(100, $ffa0a0)
;hide window while initially painting
HideWindow(100, 1) ;but see below
TextGadget(200, 5,5, 200,30, "Testing", 0)
But if I comment out the HideWindow, the window behaves just as it should.
If I add
Code: Select all
HideWindow(100, 0)
In past projects I have usually hidden a window while it is being populated with gadgets - using code just like this - so what is stopping me doing it here?
Have I made an elementary error - as usual?