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.
Remove a splash window.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Kale.
use the command when the job ends normally, if you created it by using
--Kale
In love with PureBasic!
use the
Code: Select all
CloseWindow(#Window)Code: Select all
OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Flags, Title$)In love with PureBasic!
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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.
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.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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:
Then your app won't stop, but will still catch events as they occur.
> 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%.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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.
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.