B4J Question SplitPane

DonManfred

Expert
Licensed User
Code based on an example i found some minutes ago (written by @Erel ). I just added a view to the right pane to get it listed with the codelines
B4X:
    For Each n As Node In paneLeft.GetAllViewsRecursive
        Log(n)
    Next
    For Each n As Node In paneRight.GetAllViewsRecursive
        Log(n)
    Next
which i also added

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private SplitPane1 As SplitPane
    Private paneLeft As Pane
    Private paneRight As Pane
    Private MyLabel As Label
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("main")
    SplitPane1.LoadLayout("left")
    SplitPane1.LoadLayout("right")
    For i = 1 To 5
        Dim b As Button
        b.Initialize("btn")
        b.Tag = i
        b.Text = $"Button ${i}"$
        paneLeft.AddNode(b, 10, 40 * i, 70, 35)
    Next
    For Each n As Node In paneLeft.GetAllViewsRecursive
        Log(n)
    Next
    For Each n As Node In paneRight.GetAllViewsRecursive
        Log(n)
    Next
    MainForm.Show
End Sub

Private Sub Btn_Action
    Dim b As Button = Sender
    MyLabel.Text = $"Button: ${b.Tag}"$
End Sub
 

Attachments

Last edited:
Top