10

I have made a handy toolbar that provides access to menu items that are not visible when I F12 a workbook.

enter image description here I would like to add the following function to a button in the toolbar:

magnification = 1.0;
SetOptions[SelectedNotebook[], 
Magnification :> Dynamic[magnification] ];
Slider[Dynamic[magnification], {0.8, 2, .01}]

which gives me a Slider with more control over the notebooks magnification. enter image description here

However, although I can put the Slider in a Button, when I add the Button to the row of docked cells, it won't do anything. Can this be made to work?

Kuba
  • 136,707
  • 13
  • 279
  • 740
George Wolfe
  • 5,462
  • 21
  • 43

1 Answers1

9

Basing only on your description I can't really diagnose the problem. Let me put here something what does what you need but with a slightly different approach:

You don't have to set Magnification to be dynamic and dependent of any symbols, let the Slider itself to change the Magnification:

SetOptions[
 EvaluationNotebook[],
 DockedCells -> {
   ToBoxes @ DynamicModule[{x}, 
     Slider[Dynamic[ x, 
         (x = CurrentValue[EvaluationNotebook[], Magnification] = #) &
         ], {.8, 2, .01}]
     ]
   }
 ]

enter image description here

Kuba
  • 136,707
  • 13
  • 279
  • 740