Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to make a Grid with each cell Imagesize was {10,10}.If I place any Gui-Element with more than that cell Imagesize,I don't want to scale that cell.

I want to set each cell ImageSize is {10,10}.

For this purpose,I tried with both Grid and GraphicsGrid.

If you can use Grpahicsrid,it's working fine.That corresponding code is in below.

GraphicsGrid[ConstantArray["234", {3, 4}], Frame -> All,ImageSize -> {40, 30}]

If you use Grid,it's not working.That corresponding code is in below.

 Grid[ConstantArray["234", {3, 4}], Frame -> All, ItemSize -> {10, 10}]

I think,Itemsize units totally different compared with ImageSize.That's why it's not working .

How can I resolve this ?

share|improve this question
add comment

1 Answer

There is a known-difficult problem in this:
How to convert between various ItemSize/ImageSize units?

Nevertheless:

ItemSize:

In Grid, w is measured in ems, and h in line heights. In GraphicsGrid, w and h are both measured in absolute printer's points.

Pane:

Pane[expr,{w,h}] makes the pane be w points wide, and h points high, shrinking the contents if necessary.

So we can get close with this:

Grid[ConstantArray[Pane["234", {20, 20}], {3, 4}], Frame -> All, Spacings -> {0, 0}]

enter image description here

There is however distortion as the cell sizes become very small:

enter image description here

I do not know a way around this other than manually adjusting a small negative spacing based on the pane size.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.