Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating menus in Stata

    Hello. I am trying to create a menu in Stata. After consulting the official documentation i used the following code to create an item in the User menu:

    Code:
    window menu append separator "stUser"
    window menu append item "stUser" "Example" "db mydialogbox"
    window menu refresh
    However, when i restart Stata the item disappears. Is this normal? How can i make the item permanent?

    Also, can i add items to any other menus (other than the User)?

  • #2
    Make the commands part of your profile.do maybe?
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Richard i suppose that could do the trick, but isn't the third line supposed to make the changes permanent?

      Comment


      • #4
        Wow, what an interesting question.

        I looked at the documentation for the window menu command and nowhere (that I can find) does it explicitly say that changes to the menu persists from session to session. Nowhere does it say they do not persist, though. The windows menu refresh command doesn't say it makes changes permanent, but rather than they become available - certainly within the current Stata session, nothing said about what happens afterward.

        I am inclined to think that they are not intended to persist, in part because of the effort the documentation goes through to show programs that set up menus. And because they are presented as programmer's commands, suggested that they are designed for building applications rather than customizing the day-to-day Stata experience.

        Comment


        • #5
          William the changes become available immediately after you type the first two commands. So i was curious what is going on as the official documentation does not clarify whether changes are permanent or not.

          Comment

          Working...
          X