My simple first Palette is suppose to:
- Append my packages Path to
$Path
ActionMenu["test",{"The Simple Packages Path":> AppendTo[$Path, ToFileName[{NotebookDirectory[], "02 Simple Packages"}]]}]
- Get my packages
ActionMenu["Load Packages", {"Get my package":> Get["myPackage`"]}]
- Place on the selected input cell (or on a new input cell), a given input expression, containing different place holders.
OpenerView[{"my Package", Button["construct", Paste[StandardForm@Defer@construct[Placeholder["description"],Placeholder["another description"]]]]}]
The problem is that I keep getting "shadow" messages when I click on the "get my package" action menu item. And I'm sure I'm not double loading the package intentionally. When I click on "construct", it writes Global`construct["description","another description"]
. But I'm sure I didn't define it before getting the package (I killed the kernel on my tests).
Do you know what is wrong?
(I use Get
on my packages, instead of Needs
, to ensure a clean start of the package context)
Also: do you know of a simpler way of doing the Paste[StandardForm@Defer...
that ensures both that the expression being paste isn't evaluated and that it goes into an input cell, even when there's no cell selected?