3

I would like to create a palette with a small empty bar at the bottom that displays text as the user hovers their mouse over various buttons (like at the bottom of the built-in "Basic Type-setting" palette).

I tried setting the option WindowStatusArea->True and Automatic but the status bar at the bottom doesn't show:

CreatePalette[
  PasteButton[
    Style[
      StatusArea["\[Gamma]", "esc-g-esc"], FontFamily -> "Courier", 12],
    RawBoxes["\[Gamma]"], ImageSize -> {30, 20}], 
WindowStatusArea -> True]

leads to: enter image description here

Which option do I need to set to get the status area bar at the bottom of the palette?

Kuba
  • 136,707
  • 13
  • 279
  • 740
QuantumDot
  • 19,601
  • 7
  • 45
  • 121

1 Answers1

6

WindowElements -> {"StatusArea"}

CreatePalette[
 PasteButton[  Style[StatusArea["\[Gamma]", "esc-g-esc"], 
                     FontFamily -> "Courier", 12], 
               RawBoxes["\[Gamma]"], ImageSize -> {30, 20}], 
 WindowStatusArea -> ":)", 
 WindowElements -> {"StatusArea"}]

enter image description here

Full answer:

CreatePalette[
 Table[With[{i = i},
   Annotation[Button[Row[{"Label ", i}], Print[i]], "Yeah, " <> ToString[i], "Mouse"]
   ],
  {i, 10}],
 WindowStatusArea -> Dynamic[MouseAnnotation[":("]], 
 WindowElements -> {"StatusArea"}]
Kuba
  • 136,707
  • 13
  • 279
  • 740
  • I don't see anything happening when I hover the mouse over the button; the :) icon is always there. (Mathematica 10.0.1, OS X.) – murray Nov 28 '14 at 19:37
  • @murray done :p – Kuba Nov 28 '14 at 20:09
  • @Kuba I hope I am not breaking any rule by asking this here but, could you please explain to me the need of With[{i=i},...]? Why is that necessary? What does it do / prevent? Thank you in advance! – RoberRM May 23 '19 at 23:51
  • 1
    @RoberRM, sure, take a look at https://mathematica.stackexchange.com/a/7758/5478 and let me know if that explanation is not clear. – Kuba May 24 '19 at 00:51
  • @Kuba I understood perfectly. Thank you! – RoberRM May 24 '19 at 23:57