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.

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?

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted
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

share|improve this answer
add comment

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.