On 7/21/05, Joe Van Dyk <joevandyk / gmail.com> wrote:
> On 7/21/05, Aredridel <aredridel / nbtsc.org> wrote:
> >
> > > So, when the menu bar gets clicked, a signal gets emitted in the Menu
> > > Bar object.  How can the Application Window object know that a menu
> > > bar gets clicked?  Do I need to create a new signal to notify the
> > > Application Window?
> >
> > Just define a handler for the signal that calls methods on the
> > application window object, either finding it based on navigating up the
> > widget tree, or just hard-coding:
> >
> > class MenuBar < Gtk::MenuBar
> >   def initialize(app)
> >     super()
> >     # create menu buttons
> >     @app = app
> >     # here, connect_signal -- connect_signal('clicked') { @app.frob }
> >     show
> >   end
> > end
> >
> 
> I forgot to mention that I had tried that already.  I think there was
> a problem with the super() call in MenuBar::Initialize as it was
> passing the application window object to the Gtk::MenuBar initializer.
> 

This is the error I get if I pass app in to MenuBar:
file.rb:16:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)

And line 16 looks like:
super

There's no arguments assocatiated with the super call.