I suspect the confusion is that on Mac OS, the menu-bar% is drawn at the
top of the screen (the same as DrRacket's "File" menu etc.), not inside the
window itself. This code is working for me with Racket 6.9 on Mac OS
10.12.5.

-Philip

On Mon, Aug 14, 2017 at 7:09 PM, James <jbiomant...@gmail.com> wrote:

> 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.
>

-- 
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