I'm having trouble getting a simple example of a menu bar to work.  The window 
appears with the correct frame size but no menus.  This happens whether I 
follow the example on the Stack Overflow page below or the example code I have 
shown below.  Is this a bug or do I need to do something more to make the menu 
bar show?  I am using DrRacket 6.10 macOS 10.11.6 "El Capitan."  To be on the 
safe side, I also tried it on an older machine with Racket 6.6 and Mac OS X 
10.6.8 "Snow Leopard" but I got the same result. 

https://stackoverflow.com/questions/37583997/basic-code-editor-functionality-in-racket

;Example code:

#lang racket

(require racket/gui)

(define frame (new frame%
                     [label "Example"]
                     [width 600]
                     [height 300]))


(define menu-bar (new menu-bar%
                      (parent frame)))
(define file-menu (new menu%
     (label "&File")
     (parent menu-bar)))

(define edit-menu (new menu%
     (label "&Edit")
     (parent menu-bar)))

(define help-menu (new menu%
     (label "&Help")
     (parent menu-bar)))

(new menu-item%
     (label "Foo")
     (parent file-menu)
     (callback (lambda (x y) x)))

;(send menu-bar enable #t)
(send frame show #t)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to