Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Is it Correct approach to access widgets using getID

    Isomorphic,

    Is it the right approach to use setID on widgets so that they can be accessed easily. Let me know if this is the right approach or any other alternatives to this.
    One use case would be, to access a member widget from list of members of a VLayout. setID simplifies this extremely else we need to depend on the index number which is highly unreliable in cases where lot of adding and removal of members in the widget is done.

    Thanks.

    #2
    There's no single strategy here. If you encapsulate your compound components so that sub-components are stored in instance variables, you'll never have a need for an ID. If for some reason you can't do this, ID-based tracking is one way to keep track of components, but keep in mind IDs must be unique.

    Comment

    Working...
    X