Page 1 of 1

Posted: Fri Mar 28, 2003 5:11 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.

Hello,

If I do not code the following lines
-----------------
For ireply = 1 To 12
Event = WindowEvent()
Delay (500)
Next ireply
-----------------
in the little program below, only a grey window is displayed without the text.

Is there any explanation?

Thanks,

(PB 3.62, and Windows 98 SE)

--------------------------
; open a splash Windows

If OpenWindow(0, 100, 100, 500, 400, #PB_Window_ScreenCentered, "Splash test") = 0
MessageRequester("","Unable to open Windows",0)
End
EndIf

If CreateGadgetList(WindowID()) = 0
MessageRequester("","Unable to create gadget list",0)
End
EndIf

For igadget = 1 To 10
TextGadget(igadget, 10, igadget * 30, 80, 20, "Lign " + Str(igadget), #PB_Text_Center)
Next igadget

delay(2000)

; if the following lines are not coded, the text is not displayed.
; -------------------------------
For ireply = 1 To 12
Event = WindowEvent()
Delay (500)
Next ireply
; -------------------------------

CloseWindow(0)

Delay (1000)

MessageRequester("","It is the end",0)


End
----------------------------------

Thanks,


Jean, France.

Posted: Fri Mar 28, 2003 6:18 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

try this:

Code: Select all

#TIME_TO_DISPLAY = 2000 ; milliseconds

starttime.l = gettickcount_()
If OpenWindow(0, 100, 100, 500, 400, #PB_Window_ScreenCentered | #PB_Window_BorderLess, "Splash test") = 0
MessageRequester("","Unable to open Windows",0)
End
EndIf

If CreateGadgetList(WindowID()) = 0
MessageRequester("","Unable to create gadget list",0)
End
EndIf

For igadget = 1 To 10
TextGadget(igadget, 10, igadget * 30, 80, 20, "Lign " + Str(igadget), #PB_Text_Center) 
Next igadget

Repeat
    If gettickcount_() > starttime + #TIME_TO_DISPLAY
        quit = 1
    EndIf
Until quit = 1
MessageRequester("","It is the end",0)
End
--Kale

In love with PureBasic! :)

Posted: Fri Mar 28, 2003 6:48 pm
by BackupUser
Restored from previous forum. Originally posted by plouf.

in general you need always a WaitWindowevent() or Windowevent() if you dont wand your program to halt in windows to update automatically all undesigned /destoyed gadgets

Christos

Posted: Sat Mar 29, 2003 6:56 am
by BackupUser
Restored from previous forum. Originally posted by CONVERT.

Thank you very much.

Jean, France.