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.

...or maybe switch the message. But I will be happy with no Tooltip at all.

enter image description here

I've naively tried with

Block[{$PerformanceGoal="Speed"}, ...]

because it works in case of Charts` tooltips, but with no effect :)

share|improve this question
    
I looked through definitions. It seems that Manipulator uses AnimatorBox or Animator (you can check it by evaluating FE`Evaluate@ FEPrivate`FrontEndResource["FEExpressions", "Manipulator04"][d2, d1, mrange, a, b, e, c, ap, ii, o, i, ape, auto, av, Dynamic[open], Dynamic[paused], Dynamic[rate], Dynamic[dir]]). Maybe it is simpler to solve this problem with Animator, but I don't know how to go deeper :) –  ybeltukov Jan 21 '14 at 20:46
    
@ybeltukov That's only an example, dealing with it won't help with Binomial etc. I'm looking for sort of generic approach. Not sure it isn't out of scope, but folks here know surprising things :). Thanks for your attention. –  Kuba Jan 21 '14 at 20:49
    
I tried SetOptions[.., TooltipBoxOptions -> {TooltipDelay -> Infinity}] on $FrontEndSession, EvaluationNotebook[] and as a cell option to no avail. Also tried numeric delays. Off on the wrong trail, I suppose. –  Michael E2 Jan 22 '14 at 0:05

2 Answers 2

In version 7 this suppresses the Show Animation Controls tooltip but fails to suppress the Play, Step Forward etc. ones.

Style[
 Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}],
 TooltipBoxOptions -> {DefaultLabelStyle -> {Opacity[0], 0}}
]
share|improve this answer
    
Unfortunately, in V9.0.1.0 it does not supress :/. –  Kuba Feb 5 '14 at 7:45
    
@Kuba Doesn't suppress anything? Too bad. I was hoping we could find a way to inject this setting into the template or template creation somehow. –  Mr.Wizard Feb 5 '14 at 10:07
    
No, Show animation controls is still there :/ –  Kuba Feb 5 '14 at 10:14
up vote 3 down vote accepted

Rough approach:

Tooltip resources are stored in

FileNameJoin[{
 $InstallationDirectory, "SystemFiles", "FrontEnd", "TextResources", "ToolTip.tr"}]

In order to not mess with installation directory you can copy this file to $UserBaseDirectory/SystemFiles... and replace labels you want. For example:

@@resource ToolTipCut

Cut (replace this line with your own label and save it.)

@|

  • This is a global replacement so this and each next session will be affected.

Not a big deal if your goal is to customize tooltips in Mathematica for user/client who want's different language.


More flexible approach

  • Case:

    Let's say we want to have one and only one Manipulator with changed labels.

  • Idea:

    We are changing the file during initialization and replacing it back after cell contents are displayed. We have to force FrontEnd to forget cached string resources in between those steps.

    We will use here undocumented function:

    FrontEndExecute @ FrontEnd`FlushTextResourceCaches[]
    

    to force FrontEnd to forget current resurces.


(*aux. functions,
  you need to put them in to the initialization or something similar 
  if you want them to work after reopening the notebook*)

replaceTooltip[rules_List] :=  StringReplace[ file,
    ("\n" ~~ # ~~ "\n" :> "\n" <> #2 <> "\n") & @@@ rules]

exportAndFlush[msg_] := (
  Export[  
     FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd",
         "TextResources", "ToolTip.tr"}],
   replaceTooltip[msg],
   "Text"
   ];
  FrontEndExecute @ FrontEnd`FlushTextResourceCaches[]
  )

Dynamic[
  Manipulator[Dynamic@x, Appearance -> "Open"],
  None,
  Initialization :> (
    exportAndFlush[{"Play" -> "CustomPlayLabel"}];
    SetOptions[ EvaluationCell[],  CellDynamicExpression :> 
        Refresh[exportAndFlush[{"CustomPlayLabel" -> "Play"}], None]
    ];
  )
]

enter image description here

But when we create new one it will have default label:

Manipulator[Dynamic@x, Appearance -> "Open"]

enter image description here

Keep in mind:

  • FlushTextResourceCaches[] is undocumented so maybe not stable, and not so fast. I haven't tested if one can flush resources partially, not globally.

  • This approach is basing on the assumption that CellDynamicExpression fires after Initialization. Which is not described anywhere but seems to be true from my tests.

    Why we are using this, not just evalaute flush after cell is created? Because we want this label to be preserved between sessions and if you close the notebook and open again, resources are loaded again which would overwrite our label.

  • Templates' tooltips, like Binomial, are stored in form of Rules

    @@resource TemplateBoxTooltips { Abs" -> "Abs", ...

    so you have to extend replaceTooltip function if you want to work with them.

  • code above is only to show minimal example and describe the idea. for real app you need to add additional checks about the file about pattern you use for replacement etc. etc.

share|improve this answer
    
From your spelunking do you understand why TooltipBoxOptions fails? Are the values hard-coded? –  Mr.Wizard May 21 at 8:16
    
@Mr.Wizard No, sorry :/ –  Kuba May 21 at 8:20

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.