Hey, I want to store my instances of Makie.Textbox in a matrix of size m=(L,L) where L is an integer.
The ideal situation would be:
matrix = zeros(m, Makie.Textbox)
for ...
#assign different parts of the matrix to different textboxes
end
Unfortunately, that zeros function doesn’t work. It feels weird to make a custom zeros function that creates a new figure, and makes each “zero” textbox be inside of that figure. Is there a better way to do this?
Thank you!
Usually, rather than preallocating an array with the right return type and filling that, I find it easier to use map which is like a for loop with automated storage. If you need a matrix as output, you’d need some 2d iterator as input, too, as for ..., for ... syntax doesn’t work with map. Iterators.product can fulfill this purpose, like. Here’s an example with strings, but those could also return Textboxes: