7

I often make CDF documents using Manipulate.

However, the Update(ⓤ) button created with ContinousAction-> None is too small.

enter image description here

Is there a way to make this button(ⓤ) bigger?

Kuba
  • 136,707
  • 13
  • 279
  • 740
Milk
  • 1,688
  • 10
  • 9
  • btw, can you add a simple example where this button works? I could not find it. ps. you code does not match the output, AppearanceElements clearly are not None./ – Kuba Jul 04 '17 at 10:11

2 Answers2

8

Using a custom icon and wrapping Manipulate with a function (based on @Kuba's method) that replaces the built-in icon with the custom one:

ClearAll[uicon, resizeU]
uicon[size_: 30] := Rasterize[Graphics[{GrayLevel[.7], Disk[], 
  Inset[Style["U", "Panel", Bold, White , FontSize -> Scaled[.7], 
   Background -> None]]}, ImageSize -> size], 
 ImageResolution -> 600, Background -> None]

resizeU[size_: 30] := RawBoxes[ToBoxes[#] /. MapAt[RuleCondition, DownValues[Manipulate`ManipulateBoxes], {All, 2}] /. FEPrivate`FrontEndResource["FEBitmaps", "UpdateIcon"] :> ToBoxes @ uicon[size]]&;

resizeU[60] @ Manipulate[10!, ContinuousAction -> None, AppearanceElements -> None]

Mathematica graphics

resizeU[]@ Manipulate[x, {x, {1, 2, 3}}, 
  AppearanceElements -> {"ResetButton", "UpdateButton", "HideControlsButton"}]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896
3

A general answer would need this to be available Can one effectively edit a Front End Resource that is already loaded?, but it is not.

Non trivial solution is to modify the boxes:

RawBoxes[
 ToBoxes[
    Manipulate[10!, AppearanceElements -> {"UpdateButton"}]
 ] /. MapAt[RuleCondition, DownValues[Manipulate`ManipulateBoxes], {All, 2}
 ] /. icon : FEPrivate`FrontEndResource["FEBitmaps", "UpdateIcon"] :> 
   RuleCondition @ ToBoxes @ Show[ToExpression @ FE`Evaluate @ icon, ImageSize -> 300
 ]
]

enter image description here

But as we can see the icon was designed to be small.

A better approach would be to add a custom update button:

Manipulate[10!, 
 Button[Style["U", Thick, 25], Typeset`update$$ = AbsoluteTime[], 
  Appearance -> None], AppearanceElements -> {}, TrackedSymbols :> {}]

related:

Manipulate: How to create custom reset Button automatically?

Kuba
  • 136,707
  • 13
  • 279
  • 740