6

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?

Sascha
  • 8,459
  • 2
  • 32
  • 66

1 Answers1

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:

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896