Page 1 of 1
Posted: Sat Mar 22, 2003 7:54 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.
Hello,
During a long job, I want to display a splash window with an abort button to allow the user to stop. If the job ends normally, I want to remove automatically the splash window.
Any idea?
Thanks a lot.
Jean, France.
Posted: Sat Mar 22, 2003 8:18 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.
use the
command when the job ends normally, if you created it by using
Code: Select all
OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Flags, Title$)
--Kale
In love with PureBasic! 
Posted: Tue Mar 25, 2003 9:14 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.
Thanks, Kale,
But, if I want to set an abort button, I must use the waitwindowevent command to receive the eventual user action.
If I use waitwindowevent, the program stops until the user does anything (move the mouse in the windows, for example). It is not very convenient, and slows down the process.
I tried the thread. But in this case, the windows is minimized in the task bar, I do not know why...
Any idea ?
Thanks,
Windows 98 SE. PB 3.61.
Jean, France.
Posted: Tue Mar 25, 2003 10:23 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> If I use waitwindowevent, the program stops until the user does anything
Use WindowEvent instead of WaitWindowEvent, like this:
Code: Select all
ev=WindowEvent() : If ev=0 : Delay(1) : EndIf ; Delay stops CPU being used 100%.
Then your app won't stop, but will still catch events as they occur.
Posted: Wed Mar 26, 2003 7:09 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.
Thanks,
But my window is minimized in the task bar, and I want to keep it on top.
Jean, France.
Posted: Wed Mar 26, 2003 8:13 pm
by BackupUser
Restored from previous forum. Originally posted by CONVERT.
Hello,
Please, try this :
(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)
CloseWindow(0)
Delay (1000)
MessageRequester("","It is the end",0)
End
----------------------------------
Only a blank windows appears. No text lign.
Now, add the following lines before delay(2000) :
-------------------------------
For ireply = 1 To 12
Event = WindowEvent()
Delay (500)
Next ireply
-------------------------------
Now, each lign appears one after the other each time a WindowEvent() is executed.
Is it normal?
Thanks,
Jean, France.