Skip to content

How to get Element dimensions? #395

Answered by ArthurSonzogni
kajmaj87 asked this question in Q&A
Discussion options

You must be logged in to vote

There is a 'canvas' function taking a callback. Instead of providing your own canvas of fixed size, one filling the full area is provided to you:
https://arthursonzogni.github.io/FTXUI/namespaceftxui.html#a8bef154e558868d259c52380e1e5ead9

Alternatively, you can wrap your element with 'reflect'. It will write the size/position of the box where it has been rendered to:
https://arthursonzogni.github.io/FTXUI/namespaceftxui.html#aaff8245861617a3d9e846e99de582a63

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ArthurSonzogni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants