1
$\begingroup$

I'm looking for an efficient way to define and set toolbars/docked cells for paclets. I know about TextResources folder, but it seems that one needs to put there definitions in terms of box expressions, which I dislike because: 1. It makes it more difficult to modify, especially when the toolbar contains dynamic elements which should extract some elements (say section names) from the notebook. 2. It appears that I could just as well put the expressions in terms of boxes in the stylesheet itself, without loading from resource file.

I've tried defining the toolbar within the main part of the paclet (in .m/.wl file), but this requires importing the package twice to initialize the toolbar properly. Is there a better solution?

$\endgroup$
4
  • $\begingroup$ I write stylesheets notebooks deifnitions in .m files and then build them. Check DevTools script, if the toolbar is more or less fixed it is fine. Even if it contains dynamic content then it can be Dynamic and be updated when needed by e.g. EvenHandler MouseEntered like the list of slides is updated in the slideshow toolbar. Hard to say more without specific examples. $\endgroup$
    – Kuba
    Jan 23, 2020 at 13:55
  • $\begingroup$ Thanks, this seems to be what I was looking for. I'll try it out this evening. $\endgroup$
    – Ranza
    Jan 23, 2020 at 14:07
  • $\begingroup$ Ok, it's not exactly what I wanted (it injects the docked cell to the stylesheet before building the package, not during run), but it's a huge improvement nevertheless, perhaps even a smarter approach. $\endgroup$
    – Ranza
    Jan 27, 2020 at 16:27
  • $\begingroup$ It all depends how often and what exactly will be changed in the docked cell. Unfortunately one needs to be careful about Dynamics because they like to update on window resize etc. $\endgroup$
    – Kuba
    Jan 27, 2020 at 22:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.