Rebol [Title: "Simple Menu Example"] view center-face gui: layout/size [ at 100x100 H3 "You selected:" display: field ; Here's the menu. Make sure it goes AFTER other GUI code. ; If you put it before other code, the menu will not cover ; up other widgets in the GUI. The menu is basically just ; a text-list widget, which is initially hidden off-screen ; at position -200x-200. When an item in the list is ; clicked upon, the action block for the text-list runs ; through a conditional switch structure, to decide what to ; do for the chosen item. The code for each option first ; re-hides the menu by repositioning it offscreen (at ; -200x-200 again). For use in your own programs, you can ; put as many items as you want in the list, and the action ; block for each item can perform any actions you want. ; Here, each option just updates the text in the "display" ; text entry field, created above. Change, add to, or ; delete the "item1" "item2" and "quit" elements to suit ; your needs: origin 2x2 space 5x5 across at -200x-200 file-menu: text-list "item1" "item2" "quit" [ switch value [ "item1" [ face/offset: -200x-200 show file-menu ; PUT YOUR CODE HERE: set-face display "File / item1" ] "item2" [ face/offset: -200x-200 show file-menu ; PUT YOUR CODE HERE: set-face display "File / item2" ] "quit" [quit] ] ] ; The menu initially just appears as some text choices at ; the top of the GUI. When the "File" menu is clicked, ; the action block of that text widget repositions the ; text-list above, so that it appears directly underneath ; the File menu ("face/offset" is the location of the ; currently selected text widget). It disappears when ; clicked again - the code checks to see if the text-list ; is positioned beneath the menu. If so, it repositions ; it out of sight. at 2x2 text bold "File" [ either (face/offset + 0x22) = file-menu/offset [ file-menu/offset: -200x-200 show file-menu ][ file-menu/offset: (face/offset + 0x22) show file-menu ] ] ; Here's an additional top level menu option. It provides ; just a single choice. Instead of opening a text-list ; widget with multiple options, it simply ensures that the ; other menu is closed (re-hidden), and then runs some code. text bold "Help" [ file-menu/offset: -200x-200 show file-menu ; PUT YOUR CODE HERE: set-face display "Help" ] ] 400x300