While working through example 1 in the user’s guide to foxGUIb,
I am running into problems when I try to separate GUI design and
code. Inches.rb is ok, but ExtendInches.rb doesn’t work (see the
errors file).
I’ve attached the two files.
What am I doing wrong ?
Thanks in advance,
Best regards,
Axel
On 5/28/06, [email protected] [email protected] wrote:
Thanks in advance,
Best regards,
Axel
ExtendInches.rb:17:in `initialize’: wrong number of arguments (1 for 0)
(ArgumentError)
from ExtendInches.rb:17
you get the error message because you try to instantiate an InchesX
object by calling an Inches constructor.
you are mixing “extending a class” with “deriving a subclass”
you can do both. either you extend a gui class like this:
class Inches
… foxguib generated code here
end
class Inches
def init
# … your extension code here
end
end
or you derive from the foxguib class which looks like this:
class DerivedInches < Inches
def initialize parent
super
# … your code here
end
end
hope this helps,
– henon