How do I get the name of a component?

I was expecting to get the name of each component on the form together with the text, instead the text works as expected, but the name always return "r".

for c in form.get_components():
  print '%s %s %s %s' % (type(c).__name__, c, c.text, c.name)

Output:

Label <anvil.Label object> Downloaded to FPC: r
TextBox <anvil.TextBox object>  r

Hi - worth reading this thread (and the ones @meredydd & @daviesian link to). I’ve not heard anything to suggest the situation has changed.

In summary there is a Skulpt bug requiring a work around, both are described in the link (and sub-links) above.

1 Like