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.

How can a small square button be created with ImageSize -> {20,20}?

The x-dimension won't go below about 70.

(Using version 9.0.1 on OS X.)

Grid[{
  {Button["", ImageSize -> {10, 10}],
   Button["", ImageSize -> {20, 20}]},
  {Button["", ImageSize -> {30, 30}],
   Button["", ImageSize -> {90, 30}]}},
 Frame -> All, Alignment -> Left]

enter image description here

share|improve this question
    
Works fine for me W7 MMA 8.0. –  Öskå Aug 18 '13 at 10:31
    
Win 7 V9.0 looks also Ok. –  Kuba Aug 18 '13 at 10:38
    
Thanks. I recall this working ok on Windows. –  Chris Degnen Aug 18 '13 at 10:39
    
Works fine on Linux 8.0 too. –  Öskå Aug 18 '13 at 10:41
add comment

1 Answer

The problem is that on OS X the default appearance "style button" has a minimum size. Note below that Appearance has to be set locally within each button rather than in the Style wrapper.

Style[
 Grid[{{
    Button["x", Null, Appearance -> None, ImageSize -> {10, 10}],
    Button["x", Null, Appearance -> None, ImageSize -> {20, 20}]},
   {Button["x", Null, Appearance -> None, ImageSize -> {30, 30}],
    Button["x", Null, Appearance -> None, ImageSize -> {90, 30}]}},
  Frame -> All,
  ItemSize -> All,
  Alignment -> Left],
 DefaultOptions -> {
   Button -> {
     Background -> Orange,
     BaseStyle -> Directive[FontColor -> Black, 11]
     }
   }]

enter image description here

share|improve this answer
    
Thanks. Appearance -> "Palette" is a palatable solution. –  Chris Degnen Aug 18 '13 at 11:09
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.