hi there =)
strange thing...
i have a program that generates a html fil out of a list of jpegs in a directory...
works fine, but could take a while, so i wanted some output.
but as soon as i include a window or console (only opening... no output yet!) the program will just end up somewhere in the middle.
allways the same position where it ends... now...
when i move the window/console line from the top to below my variable/constants defenition part, or somewhere later in the code, the position where the program ends is different.
can this be? (im not drunk or such)
thx in advance
muaB
program just ending when i use a window/console?
If OpenWindow ( 0, 512-200, 384-75, 400, 75, #PB_Window_ScreenCentered | #PB_Window_BorderLess, "TEST" )
CreateGadgetList ( WindowID() )
TextGadget ( 1, 0, 0, 400, 75, Chr ( 13 ) +version+Chr ( 13 ) +Chr ( 13 ), #PB_Text_Center | #PB_Text_Border )
EndIf ; openwindow
or
if openconsole() : else : end : endif
both does open a window...
but for some reason (really, the windows are used in no way, just opened) this is enough...
CreateGadgetList ( WindowID() )
TextGadget ( 1, 0, 0, 400, 75, Chr ( 13 ) +version+Chr ( 13 ) +Chr ( 13 ), #PB_Text_Center | #PB_Text_Border )
EndIf ; openwindow
or
if openconsole() : else : end : endif
both does open a window...
but for some reason (really, the windows are used in no way, just opened) this is enough...
do you have an Event Loop in your code?
like this...
like this...
Code: Select all
; PureBasic Visual Designer v3.63d Beta
;- Window Constants
;
#Window_0 = 0
;- Gadget Constants
;
#ButtonOK = 0
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 600, 300, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
If CreateGadgetList(WindowID())
ButtonGadget(#ButtonOK, 85, 225, 125, 40, "Ok")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
Until Event = #PB_EventCloseWindow
End
