Forum: wxRuby MenuBar doesn't show

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Luc T. (Guest)
on 2008-12-09 22:48
(Received via mailing list)
Hi all,

I am totally new to Ruby and Wx so i'd appreciate it if someone could
tell me why my menubar doesn't show

Here is the code (running on Vista...):

class MinimalApp < App
    def on_init
      @frame = Frame.new(nil, -1, "Lister")
      @frame.set_client_size(600,400)

      @sizer = BoxSizer.new(VERTICAL)

      @menubar = MenuBar.new

      @file = Menu.new
      @open = @file.append("Open", "open")
      @menubar.append(@file, "File")

      @sizer.add(@menubar, 0, GROW|ALL, 2)

      @frame.set_sizer(@sizer)

      @frame.show
    end
 end

Thanks
Omar H. (Guest)
on 2008-12-10 00:44
> class MinimalApp < App
>     def on_init
>       @frame = Frame.new(nil, -1, "Lister")
>       @frame.set_client_size(600,400)
>
>       @sizer = BoxSizer.new(VERTICAL)
>
>       @menubar = MenuBar.new
>
>       @file = Menu.new
>       @open = @file.append("Open", "open")
>       @menubar.append(@file, "File")
>
>       @sizer.add(@menubar, 0, GROW|ALL, 2)
>
>       @frame.set_sizer(@sizer)
>
>       @frame.show
>     end
>  end

Well,I've not tryed the syntaxis but, apparently you need: to use
set_menu_bar(@menubar).

Maybe a @frame.set_menu_bar(@menubar) would do the job.
Luc T. (Guest)
on 2008-12-10 00:59
(Received via mailing list)
Omar H. a écrit :
>>       @open = @file.append("Open", "open")
>
> Well,I've not tryed the syntaxis but, apparently you need: to use
> set_menu_bar(@menubar).
>
> Maybe a @frame.set_menu_bar(@menubar) would do the job.
>
Yes it does the job, thanks.
This topic is locked and can not be replied to.