Starting items

Post

Posted
Rating:
#1 (In Topic #111)
Avatar
Guru
cogier is in the usergroup ‘Guru’
Is there a way to get something to start AFTER the Form has been displayed other than using a Timer.

Example: - I want to display a Form then play a tune. If I put it in Public Sub Form_Open() it will not show the Form until the tune has played.
Online now: Yes Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Try adding Wait before the play.

If Delay is not specified, the function processes all pending events and returns immediately. In that specific case, input events (keyboard and mouse) are ignored.

Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
Ahh. So simple, why didn't I think of that? BUT it doesn't work!!

The attached uses a Timer to get the result I am looking for. Simply change 'bWait As Boolean = True' to
'bWait As Boolean = False' to see that it doesn't react as expected.

Please note the software is in the VERY early stages of development..

Attachment
Online now: Yes Back to the top

Post

Posted
Rating:
#4
Regular
didier18 is in the usergroup ‘Regular’
 Hello

Can be put the code in:
Public Sub Form_Arrange ()
or in :
Public Sub Form_Show ()

Have a good day

Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
jornmo is in the usergroup ‘Regular’
I've tried did's solution.

This works:

Code

Public Sub Form_Show()
  
  playStuff("4C2,3C2,2C2,1E2,1D2,1C8,\n")                       'Send Intro string of notes to playStuff
  
End

However, the Arrange event is not good for this.

Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Btw., '28.wav' is missing  :?

Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Guru
cogier is in the usergroup ‘Guru’
 Well done Didier that did the trick, I used Form_Show()

The missing note has been recaptured!
Online now: Yes Back to the top

Post

Posted
Rating:
#8
Avatar
Guru
cogier is in the usergroup ‘Guru’
UPDATE:

Form_Show() only shows the form immediately with gb.gui
Form_Arrange() does not show the form until the the routine has finished
Form_Open() does not show the form until the the routine has finished
Form_Active() shows the form immediately with gb.gui and gb.qt4

You need one Label on a form for this to work

Code (gambas)

  1.  
  2. Public Sub Form_Activate()
  3. Dim siCount As Short
  4. Dim siNotes As Short[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
  5.  
  6. For siCount = 0 To siNotes.Max
  7.   Label1.text &= siNotes[siCount] & " "
  8.   Wait 0.25
  9.  
Online now: Yes Back to the top

Post

Posted
Rating:
#9
Avatar
Regular
jornmo is in the usergroup ‘Regular’
Oooohh! I like the colours  :lol:

Online now: No Back to the top
1 guest and 0 members have just viewed this.