# Can palettes dock to notebooks?

Over on Meta: A wishlist for Mathematica

I got an interesting comment on the following suggestion and thought it merited a stand alone question:

re: NOTEBOOK INTERFACE USABILITY & ORGANIZATION

Dock palettes -- When I use palettes, I'd love the ability to just stick them on to the side of a notebook window so I don't have to keep searching for them.

Comment:

This may be able to be done using docked cells. @rcollyer

See: DockedCells in the documentation.

I recognize that Wolfram builds palettes as notebooks and I can imagine that one could create a custom palette whose cells one could dock at the top of another notebook (this would work great if one could split a notebook into panes and scroll through them separately so one always had access to the palette). Just not certain I see a clear way to do this with a supplied palette.

So, does anyone know how to dock a palette to a notebook (or any reasonably functional equivalent)?

• 404 "A wishlist for Mathematica" – alancalvitti Sep 4 '14 at 23:12
• Your link for the wish list does not work any more! – H. R. Jan 27 '16 at 17:01

You can simply assign the content of the palette to the docked cells, however this won't give any nice results for palettes that where not designed to be used as such:

For instance, first open up a palette, I chose Basic Math input, then run

plt = Notebooks[][[1]]
CreateWindow[DockedCells -> NotebookGet[plt][[1]]]


What you then end up with is a notebook with that palette docked, in this case and with most other palettes the result is quite horrible to look at.

• I thought it might look more horrible than it actually does... Nice trick! – Thomas Sep 19 '12 at 15:24
• Nice trick indeed. Thx. – Jagra Sep 19 '12 at 15:30
• Hehe, now we need to do this automatically for every palette, throw in some bright colors and then it'll look like my mom's Internet Explorer window :D – rm -rf Sep 19 '12 at 15:30
• @Jagra I think the important thing to note is that you have access to everything in the palette, so if you wanted to perhaps dock a couple of the buttons, you could just fish them out and use them in your own custom dock. But of cause then your close to just building your own dock from scratch. – jVincent Sep 19 '12 at 15:33

Building off of jVincent's idea here's a way to make it take up less space:

plt = NotebookGet[Notebooks[][[1]]][[1]];
CreateWindow[
DockedCells ->
ReplacePart[
plt,
{1, 1, 1, 2, 2, 1} ->
Partition[Flatten@plt[[1, 1, 1, 2, 2, 1]], 2]
]
]


I just looked inside the thing and flattened the primary GridBox.

• I won't work for every palette, will it? BasicMath is not OP's case but jVincent's so maybe you can make this an edit to his answer? You made it CW anyway. – Kuba Jan 10 '18 at 9:15