What I’m trying to do:
Hi,
I’m still a new comer with Anvil. Sorry for this simple question, but it could help other beginners…
I want to get the height of a TextArea component that has just been created dynamicly in a XYpanel. This TextArea is expendable, and then can have a variable height.
What I’ve tried and what’s not working:
I’ve tried different ways, such as using its attribute .height (see the code sample), the .get_height(), but it is for canvas…
But it returns nothong or an error.
Could you help me, please ?
Thanks,
J.Marc
Code Sample:
Création of the question in column panel
self.quest = TextArea(text=question,
enabled=False,
align="left",
font_size=14,
background="theme:Primary",
foreground="theme:On Primary",
auto_expand=True,
spacing_above=None,
spacing_below=None,
)
self.quest.tag.nom = "question"
self.cp.add_component(self.quest, x=xx+5, y=yy, width="default")
h = self.quest.height
print(h)