This is an offshoot of how to create a menu as the Documentation Center?...
My aim is to build a menu that functions kind of like the documentation center...a grid of rectangles, each with a dropdown menu, which contains various functions (not documentation). After selecting the function, I'd like the window to be replaced with whatever the function calls. Then, upon closing the new window, the original menu interface returns. I've created an extremely rough piece of code to demonstrate:
DynamicModule[{x = {}},
Grid[{{ActionMenu[
"Sunset", {"Today" :> (x = CreateDocument@Sunset@Today),
"Next Week" :> (x = CreateDocument@Sunset@DatePlus@7)}],
ActionMenu[
"Moon Phase", {"Today" :> (x =
CreateDocument@MoonPhase[Today, "Icon"]),
"Next Week" :> (x =
CreateDocument@
MoonPhase[DatePlus@7, "Icon"])}]}, {ActionMenu[
"GeoLocation", {"City" :> (x = CreateDocument@$GeoLocationCity),
"Country" :> (x = CreateDocument@$GeoLocationCountry)}],
ActionMenu[
"Map", {"Here" :> (x = CreateDocument@GeoGraphics@Here),
"Hawaii" :> (x =
CreateDocument@
GeoGraphics@
Entity["AdministrativeDivision", {"Hawaii",
"UnitedStates"}])}], Dynamic@x}}]]
Which gives the following output:
When I click on an
ActionMenu
and select one of the functions, a new window opens with the function. How can I have the menu window replaced by the new function, and then when I close the new window, the old menu window returns? I know there is aDeinitialization
in theDynamicModule
documentation, but I haven't figured that out, and I see that only works once...can it be set to repeat infinitely?How can I get rid of the
{}
?Can I put the entire output in a standalone window/notebook ala
CreateDialog
?
If there is a better way to do this I'm all ears. I know the output is ugly, I just want to get the basic functionality working first.