MaxGUI – AddGadgetItems – update

I’ve added a new interesting feature (at least for me :D) about my special command AddGadgetItems.

The function adds in one batch many items to the gadget, so you can pass an array, a map or a list to add the items to it.

One limit in the case of passing a list, is that only ‘string list’ are working, while if the list contains objects/classes, the function is meaninless.

So, I’ve decided to change a little the function, and thanks to REFLECTION it’s possible to pass to it a combination of CLASS and FIELD to specify what ‘string’ must be added to the gadget.

Very useful 🙂

The new syntax is now the following

where gadget is the gadget to add the items, obj is the container (array, list or map), sel to select a specific item in the item-list and finally _class

_class must be in a specific form CLASS.FIELD, as the function via Reflection will find the original class and field to extract the info to add (at the moment it works ONLY for STRING FIELD only.

The item in the gadget will point to the ‘object’… so it’s possibile to access to the class/object directly.

This is the new code for the function AddGadgetItems()

local_offerevent_note April 25, 2019

account_box degac

Leave a Reply

Your email address will not be published.