B4J Question Is a Pane not masking its content?

sorex

Expert
Licensed User
Longtime User
Hello,

Is a pane in java not masking it's content to the given boundaries?

When I add something to a pane and place it to a position bigger than the size of the pane the object is still visible.


B4X:
#Region  Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 400
#End Region

Sub Process_Globals
Private fx As JFX
Private MainForm As Form

Dim p As Pane
Dim l As Label
Dim tmr As Timer
End Sub

Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
p.Initialize("")
p.Style="-fx-background-color:#808080"
MainForm.RootPane.AddNode(p,0,0,300,300)
l.Initialize("")
l.Style="-fx-background-color:#bbbbbb"
p.AddNode(l,100,100,100,100)
tmr.Initialize("tmr",1000)
tmr.Enabled=True
End Sub

Sub tmr_Tick
l.Left=l.Left+50   
End Sub
 

sorex

Expert
Licensed User
Longtime User
can I force the clipping by code aswell?


Note that it is a mistake to set the Style property directly. You should use CSSUtils instead.

ok, I was not aware that it could cause issues this way as it always worked fine.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
that's what I do now, use a layout file with the pane.

not really a mistake when doing editors where it's all about code generated content. ;)
 
Upvote 0
Top