B4J Question Error to do with rootpane, mainpain and other panes [Solved]

Peter Lewis

Active Member
Licensed User
Longtime User
Hi All

I think my understanding of the panes could be the problem

Please can someone explain it to me when I am going wrong

I have an app with my main code module

B4X:
    MainForm = Form1
    MainForm.RootPane.LoadLayout("RootLayout") 'Load the layout file.

then I got another Code module called playgame

in Sub Start:
    Main.RootPane.RemoveAllNodes
    Main.RootPane.LoadLayout("playgame") 'Load the layout file

Up to this point every thing works well

When I want to change the colour of one of the buttons in the layout

B4X:
form.Stylesheets.Add(File.GetUri(File.DirAssets, "RedButton.css"))
    form.Show

I get an error on the first line

Thank you
 

Peter Lewis

Active Member
Licensed User
Longtime User
I made that variable the same at the Form name of the root of the designer , but the SwiftButtons work perfectly



I thought it was a form as it said Form title , MyBad
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…