6
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ 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./ $\endgroup$ – Kuba Jul 4 '17 at 10:11
5
$\begingroup$

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]

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

$\endgroup$
  • $\begingroup$ You gave me new information. thank you very much. $\endgroup$ – user21427 Jul 5 '17 at 23:17
  • $\begingroup$ @user21427, my pleasure. Thank you for the accept. $\endgroup$ – kglr Jul 5 '17 at 23:21
2
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Thank you for your reply. $\endgroup$ – user21427 Jul 5 '17 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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