dkl
Full Member
Posts: 234
|
Post by dkl on Jul 7, 2021 21:32:31 GMT -5
I thought I recently saw a short bit of code that closed a "notice" box after 5 seconds?
I searched and searched was it in my imagination? Any ideas where it was?
Thank you
PS Anyway to turn off the annoying sound it makes all the time?! (Apart from change the sound in 'Windows')
|
|
|
Post by Chris Iverson on Jul 7, 2021 21:48:17 GMT -5
I could be wrong, but it probably wasn't a notice box.
Rather, it was probably a custom window that they opened and closed at the wanted times.
Using a custom window would also take care of the sound issue.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jul 8, 2021 0:13:13 GMT -5
Oh, shame. I've tried a custom window, which works well, but the moment it closes, it crashes the rest of the programme and closes LB down! I have used custom windows before and never had a problem. It only happens when it returns to the main programme. I've tried the custom window by itself and it works fine Within the programme i exit the custom window correctly and close the window. The only code after is as below.
'GO TO CUSTOM WINDOW HERE
#1.listbox3, "reload"
OR GO TO CUSTOM WINDOW HERE - neither work
#1.listbox3, "show": #1.listbox0, "hide": #1.listbox1, "hide": #1.listbox2, "hide" sb = 0 wait
this is my custom window code. I get a bad file error on #wpu, before it closes
[notify] nomainwin 'sb=2 'pi = 1 'f = 21 'Data$ = "Clint Eastwood" if sb = 1 then msg$ = f;" films found directed by ";Data$ if sb = 2 then msg$ = f;" files found with ";Data$;" in your Film Catalogue" if sb = 3 then msg$ = f;" ";Data$;" films found in your Film Catalogue" if pi = 1 then msg$ = "Go to Directory to commence viewing this TV Series" BackgroundColor$ = "darkred" TextboxColor$ = "lightgray"
WindowWidth = 390 WindowHeight = 50 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) textbox #wpu.tb1, 10, 13, 370, 25
open f$ for Window_popup as #wpu #wpu.tb1,"!font georgia 10" #wpu.tb1, msg$ playwave "L:\_WAV\plop.wav",async timer 3000,[quit_notify] wait [quit_notify] close #wpu return
|
|
|
Post by Chris Iverson on Jul 8, 2021 0:17:32 GMT -5
At a guess, you don't stop the timer that closes the window.
It will keep ticking every 3 seconds until you stop it.
The first time, it works fine and closes the window successfully.
When the timer fires again, it jumps to [quit_notify] again, and tries to close a window that's already been closed.
Add a "timer 0" to the beginning of the [quit_notify] handler.
|
|
dkl
Full Member
Posts: 234
|
Post by dkl on Jul 8, 2021 1:44:08 GMT -5
That's it, Chris!! Thank you
|
|