# Load\_panel\_subclass help

**URL:** <https://www.ruby-forum.com/t/load-panel-subclass-help/148640>\
**Category:** wxRuby\
**Created:** [September 15, 2008, 8:34pm UTC](https://www.ruby-forum.com/t/load-panel-subclass-help/148640 "2008-09-15T20:34:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [September 15, 2008, 8:34pm UTC](https://www.ruby-forum.com/t/load-panel-subclass-help/148640/1 "2008-09-15T20:34:25Z")

</div>

Hi all,  
i’m having several problems using ‘load\_panel\_subclass’ function.

The way i suppose to use it is in main\_frame.rb on attached file but i  
get  
an arror.

could somebody tell me how to use it?

I’m working on win xp sp2 ruby 1.8.6 patchlevel 111 wxruby 1.9.8  
wx\_sugar  
0.1.20

thank you all.

Fabio.

---

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [September 16, 2008, 2:30pm UTC](https://www.ruby-forum.com/t/load-panel-subclass-help/148640/2 "2008-09-16T14:30:25Z")

</div>

Fabio P. wrote:

> i’m having several problems using ‘load\_panel\_subclass’ function.
> 
> The way i suppose to use it is in main\_frame.rb on attached file but i  
> get an arror.
> 
> could somebody tell me how to use it?

You don’t need to use load\_panel\_subclass here at all - calling it is an  
error. The ‘CONTATTI’ panel is already part of the overall layout of the  
frame and so is loaded anyway when the whole frame is loaded.

load\_panel\_subclass is only used for when you have a top-level panel  
(ie, no parent) defined in your XRC file, and want to load that panel as  
the child of an arbitrary window.

hth  
alex

---

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [September 16, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/load-panel-subclass-help/148640/3 "2008-09-16T15:22:08Z")

</div>

Thank you Alex,

the problem is related on code organization:

The xrc file consist of 1 frame and, inside it, a notebook with 2  
folders  
(panels).  
Conceptually they are separated objects with their own code and logic.

What i need is to separate these entities into their own class for  
better  
code organization avoiding to encapsulate them into a external custom  
proxy  
class: that’s the reason i used ‘load\_panel\_subclass’.

cheers

fabio.
