While creating a lib, I am facing an uncommon issue... My lib will add a button to the MainForm.RootPane but the X position will depend of the presence or not of a menubar. How can I chech if an object (node) of the menubar type exists?
Thanks Rob, exactly what I was looking for... I also was successful by converting the object to a string and check the first 7 characters... kinda of made it more complex than needed although it worked.
Another solution is to use the View Tag Property (assign unique value or string) to search in case if of multiple same type of views, like
B4X:
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If n.Tag <> Null And n.Tag = "MenuBarA" Then
Log("MenuBarA found")
End If
Next
Note: Changed first code snippet by adding if n.Tag <> Null according hint in post #5
Or
B4X:
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
Dim s As String = n.Tag
If s.EqualsIgnoreCase("MenuBarB") Then
Log("MenuBarB found")
End If
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.