Group Abstract Group Abstract

Message Boards Message Boards

Make an index with a popup menu?

Posted 9 years ago

I am looking for san index, small and versatil, like a popup menu, may be with hyperlinks. I have a few notebooks, say nb1, nb2, nb3, nb4. I would like to make small "Index" with a popupmenu so that when a clicked in each item,l abeled nb1, nb2,..., then the respective notebook open.

I've been very cheeky trying to create some code, but of course this far from working well. My code is

DynamicModule[{var = "nb1.nb", 
  nb1lst = {"nb1.nb", "nb2.nb", "nb3.nb", "nb4.nb"}},
 Column[{
   PopupMenu[
    Dynamic[var], {1 -> "nb1", 2 -> "nb2", 3 -> "nb3", 4 -> "nb4"}],
   PaneSelector[{
     1 -> 
      Dynamic@NotebookOpen[
        FileNameJoin[{NotebookDirectory[], 
          TextString[nb1lst[[var]]]}]],
     2 -> 
      Dynamic@NotebookOpen[
        FileNameJoin[{NotebookDirectory[], 
          TextString[nb1lst[[var]]]}]],
     3 -> 
      Dynamic@NotebookOpen[
        FileNameJoin[{NotebookDirectory[], 
          TextString[nb1lst[[var]]]}]],
     4 -> 
      Dynamic@NotebookOpen[
        FileNameJoin[{NotebookDirectory[], 
          TextString[nb1lst[[var]]]}]]},
    Dynamic[var]]}]
 ]

Well, can you help me?

POSTED BY: W Mora
2 Replies
Posted 9 years ago
POSTED BY: W Mora
POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard