B4J Question Nodes add to a Pane are not inside the Pane

shirlun

Active Member
Licensed User
Longtime User
The following code add two Nodes to a Pane, but the new nodes are outside.

How to make the nodes inside a Pane ? Thanks.

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
End Sub

Sub AppStart (form1 As Form, Args() As String)

    MainForm = form1
    MainForm.Show

End Sub

Sub MainForm_Resize(w As Double, h As Double)
   
    Dim p, p1 As Pane
    Dim b As Button
   
    p.Initialize("")
   
    CSSUtils.SetBackgroundColor(p,fx.Colors.Blue)
   
    p1.Initialize("")
    CSSUtils.SetBackgroundColor(p1,fx.Colors.Cyan)
   
    p.AddNode(p1, 150,50,100,50)
   
    b.Initialize("")
    p.AddNode(b, 150,110,100,50)

    MainForm.RootPane.AddNode(p,10,10,200,200)
   
End Sub
 

Attachments

  • cap.JPG
    91.4 KB · Views: 237

shirlun

Active Member
Licensed User
Longtime User
Thank you,

Can I clip views by coding ? because I need to add nodes to a pane in run time.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…