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.
43a95279874adcdd785a067b40e9dea3?d=identicon&s=25 Luc Traonmilin (Guest)
on 2008-12-09 21: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
8169bd2772aa4c151c8688dd1b08348e?d=identicon&s=25 Omar Hernandez (ramo)
on 2008-12-09 23: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.
43a95279874adcdd785a067b40e9dea3?d=identicon&s=25 Luc Traonmilin (Guest)
on 2008-12-09 23:59
(Received via mailing list)
Omar Hernandez 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.