I am trying to find a way to have an item in a grid cell that always fill the available vertical space enforced by the remaining items (without enforcing any row height itself).
One of my (many) failed attempts:
Grid[{{
Item[
Style[
Pane["", ImageSize -> {Scaled@1, Full}],
Background -> Green
],
ItemSize -> {1, Full}
],
Style[
Pane["", ImageSize -> {10, 200}],
Background -> Yellow
]
}},
Frame -> All,
Spacings -> 0
]
The green rectangle is supposed to fill the left cell entirely (and adjust its size if the size of the yellow rectangle is changed).
Update: The end goal of this is to have a cell-filling EventHandler
expression. So anything of the form Grid[{{EventHandler[…], …}}, …]
works for me, as long as the EventHandler
fills the whole cell.
Is something like this possible?
Grid[{{Item[ Button["", None, Appearance -> "FramedPalette", Background -> Green], ItemSize -> {1, Full}], Style[Pane["", ImageSize -> {10, 200}], Background -> Yellow]}}, Frame -> All, Spacings -> 0]
? $\endgroup$ – kglr Jan 22 '20 at 22:34Appearance
of the button toNone
seems to break the auto-sizing property of the button. (An explicitImageSize -> Full
doesn't seem to help either...) $\endgroup$ – Lukas Lang Jan 23 '20 at 8:54Enabled->False
to the button and wrapping it inEventHandler
does the trick, although it seems a bit hacky... Can you post your comment as an answer so I can accept it? $\endgroup$ – Lukas Lang Jan 23 '20 at 9:16EventHandler
bit.) $\endgroup$ – kglr Jan 23 '20 at 13:48