# How to put Magnification control in docked cell

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.

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?

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}]
]
}
]


• Nice! I'll use this. It's not at all what I would have done, so I'll use it to figure out what I didn't know. Feb 19 '16 at 22:19
• @GeorgeWolfe Feel free to ask if anything is not clear.
– Kuba
Feb 20 '16 at 6:46
• related Feb 20 '16 at 9:21
• @SimonWoods at least closely :)
– Kuba
Feb 20 '16 at 9:22