# foxGUIb GUI and code separation question

**URL:** <https://www.ruby-forum.com/t/foxguib-gui-and-code-separation-question/95320>\
**Category:** Ruby\
**Created:** [May 28, 2006, 11:03am UTC](https://www.ruby-forum.com/t/foxguib-gui-and-code-separation-question/95320 "2006-05-28T11:03:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 28, 2006, 11:03am UTC](https://www.ruby-forum.com/t/foxguib-gui-and-code-separation-question/95320/1 "2006-05-28T11:03:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 28, 2006, 10:27pm UTC](https://www.ruby-forum.com/t/foxguib-gui-and-code-separation-question/95320/2 "2006-05-28T22:27:57Z")

</div>

On 5/28/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto: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

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
