Normally I try to stay away from asking RTFM- questions but concerning docked cells I am currently groping in the dark. The documentation examples tell me how to create a new window containing a docked cell, but not how to setup a cell as docked cell in my existing .nb file. Am I to use (edit) the notebooks stylesheet or is there a command like e.g. SetOptions for that matter?
Asked
Active
Viewed 372 times
6
-
Ummm... what is RTFM? – David G. Stork Apr 03 '23 at 23:33
-
1@DavidG.Stork it is short for "Read the f*ing manual" and a typical internet response to basic questions for which the answer can easily be found in the usage manual :D – Sascha Apr 04 '23 at 08:13
1 Answers
11
CurrentValue[EvaluationNotebook[], {DockedCells}] = Cell["XXXX", "DockedCell"]
or
SetOptions[EvaluationNotebook[], DockedCells -> Cell["XXXX", "DockedCell"]]
example:
buttons = Row[{Button["Print Date", Print[DateString[]]],
Button["New Document", CreateDocument[{}]]}];
CurrentValue[EvaluationNotebook[], {"DockedCells"}] =
Cell[BoxData[ToBoxes[buttons]], "DockedCell"]
See also the tutorial Introduction to Toolbars for detailed examples like the one that gives:

kglr
- 394,356
- 18
- 477
- 896