B4J Question Wait for needs the event sub to exist?

Cableguy

Expert
Licensed User
Longtime User
I have a "Wait For Pane1_AnimationCompleted" in a sub, and it works as expected, except that if the event sub is not present, in this case, "Pane1_AnimationCompleted", the app crashes, with the following logs:

B4X:
Waiting for debugger to connect...
Program started.
An error occurred:
(Line: 56) End Sub
java.lang.Exception: Sub pane1_animationcompleted signature does not match expected signature.
public static void b4j.example.launcher_subs_0._pane1_animationcompleted() throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject,
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
i suppose you are calling back the sub with callsubdeleyed()

may be you could use also if subexists() function.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
No, I'm not, just what I wrote...

I call the animation:
B4X:
 Pane1.SetAlphaAnimated(50,1)
 Wait For Pane1_AnimationCompleted
Pane1.SetLayoutAnimated(100,Pane1.Left,Pane1.Top,285,60)

This waits for the pane to became fully visible, and them enlarges it.

but without the Pane1_AnimationCompleted sub, it crashes after completing the code
 
Upvote 0

EnriqueGonzalez

Expert
Licensed User
Longtime User
It doesnt break anything here if i do not put that line.

And i think that if it were an external lib, it would be that the creator forgot to put the callsubdelayed call, but it is actually the core library.

i am using JCore 5.80
 
Upvote 0

EnriqueGonzalez

Expert
Licensed User
Longtime User
with both, separeted and at the same time, they behave as expected. In diferent scenarios with wait for in the middle, at the end, one wait for for each call.

No problem at all.

i am using jdk 8u144
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I will, near lunch time, hopefully
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Hi again, Here goes a simplified test that errors out as described.

my Java version is:
java version "1.8.0_141"
 

Attachments

  • BugTest.zip
    2.9 KB · Views: 173
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What are the steps to reproduce it? I've ran it and didn't see anything.

Note that you don't need that timer. Just call Sleep:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.SetFormStyle("UTILITY")
   MainForm.WindowTop = -1000
   MainForm.Show
   Sleep(200)
   MyLauncher.Initialize(MainForm)
End Sub
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I forgot about the timer, it's there for another reason... Bring your mouse to the upper left corner of the screen, there's a 1x10px label there that will trigger the animation
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
So I'm Not crazy!? (after the sleep thread I started doubting myself)

You said in debug mode, so in release it should run ok?
 
Upvote 0
Top