B4J Question How to verify if an object can be added as a children of a node ?

TelKel81

Active Member
Licensed User
I think that one of the ways to validate that is by checking if the object extends the Node class, but how do I extract this information ?

I'm currently "validating" by using a Try Block but that's not elegant :)
 
Last edited:

TelKel81

Active Member
Licensed User
Yes :)
I pass an object to a sub. The object is either a view or classes which have a view.

I want to determine if the passed object can be added as a children of a parent (without throwing an error).

If it can't be added as a children it means that I need to run a get method on the object before adding the view.

I also understand that I could make another sub for that specific set of classes but I thought maybe there's a quick way to verify what I described.

Sorry I'm french canadian my english is not very good :p
 
Upvote 0

TelKel81

Active Member
Licensed User
I'm 100% confident that I couldn't feel dumber ;)

Among the objects where Gridpane/VBox classes that aren't built-in so I thought they would not pass the B4XView test but... they do :)
Sorry for wasting your time.

Thanks for the reliable support.
 
Upvote 0

TelKel81

Active Member
Licensed User
I still have a troubling issue...

ANY class returns true when testing "SomeClass Is B4XView" ???

B4X:
Dim test As Someclass 'empty class
test.Initialize
Log(test Is B4XView) 'outputs true

I included a project.
 

Attachments

  • test.zip
    2.8 KB · Views: 61
Upvote 0
Top