Forum: Ruby foxGUIb GUI and code separation question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-05-28 13:03
(Received via mailing list)
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,

Meinrad R. (Guest)
on 2006-05-29 00:27
(Received via mailing list)
On 5/28/06, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid> 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

class Inches
  def init
    # ... your extension code here

or you derive from the foxguib class which looks like this:

class DerivedInches < Inches
  def initialize parent
    # ... your code here

hope this helps,
-- henon
This topic is locked and can not be replied to.