Hi,

I just want to create a subclass of Gtk::Windows and set parameters for
the initialize method of this subclass. Here is the simple code:

#!/usr/bin/ruby
require 'gtk2'

class RubyApp < Gtk::Window
    def initialize( a , b)
        super
        signal_connect "destroy" do
            Gtk.main_quit
        end
        @columns = a
        @rows = b
        init_table(@columns,@rows)
        show_all
    end
    def init_table (columns, rows)
      table = Gtk::Table.new(columns,rows)
      my_button=Array.new
      for a in 0..3
        my_button[a] =Gtk::Button.new("boite numero :"+a.to_s)
        table.attach(my_button[a],0,4,a,a+1)
      end
      add table
    end
end

Gtk.init
    window = RubyApp.new(4, 5)
Gtk.main

If i run the script, I get this error:
in `initialize': wrong number of arguments (2 for 1) (ArgumentError)

I try a lot of things and after a lot of research on the net, I can't
find the solution or the tricks that should solve the problem.

Have you got any idea why I can't define new parameters for the
initialize method.

Thanks

-- 
Posted via http://www.ruby-forum.com/.