Bug? Add pane in code

stevel05

Expert
Licensed User
Longtime User
I am trying to add a pane in code using:

Pane1.Initialize("Pane1")
Log(Pane1.IsInitialized)
MainForm.RootPane.AddNode(Pane1,0,0,100,100)
B4X:
Pane1.Initialize("Pane1")
Log(Pane1.IsInitialized)
MainForm.RootPane.AddNode(Pane1,0,0,100,100)

I get an error that the pane needs to be initialized.

Log(Pane1.IsInitialized) returns false.


Is this a bug or do I need to do it differently?



Test project attached.

Thanks

[Edit] A label works as expected.

Also can't add a layout within a class, variables are initialized in Main. See AddPaneTest2.
 

Attachments

  • AddPaneTest.zip
    531 bytes · Views: 368
  • AddPaneTest2.zip
    1.4 KB · Views: 394
Last edited:
Top