I have created a grid, and also made a list of control objects(ex:inputfields, buttons, etc..). Then, I lay the list in my grid. There is no problem. However, the final layout takes a lot of time. I timed each operation and realized that the final grid layout is the one that takes up a huge chunk of time. Is there a better way of controlling the execution time of the graphics grid.
mygrid = ConstantArray["", {100, 100}];
mybutton1 = Button["Example", ImageSize -> {40, 50}];
myinput2 = InputField[x];
updatedlist = {};
updatedlist = ReplacePart[mygrid, {1, 2} -> mybutton1];
updatedlist = ReplacePart[updatedlist, {2, 3} -> myinput2];
Panel[GraphicsGrid[updatedlist, ImageSize -> {30, 40},
ContentSelectable -> True]]
The above code takes a lot of time to execute. I used the Timing
function of mathematica to figure out which part took the long time to execute and it was the Panel[GraphicsGrid[updatedlist, ImageSize -> {30, 40},
ContentSelectable -> True]]
part that was the longest. Because of this, my entire application has slowed down. Can I finetune my code to improve the performance? Look forward to hearing your inputs!
Based on the comments blow, I tried to use a grid for the updatedlist
above, but the problem is, how can I set the ImageSize
of the Grid
which is an option for the GraphicsGrid
and not Grid
?
Thanks in advance,Anuk
Grid
help for defining theImageSize
for items. $\endgroup$