# Xrc panels using xrcise

**URL:** <https://www.ruby-forum.com/t/xrc-panels-using-xrcise/145660>\
**Category:** wxRuby\
**Created:** [August 12, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/xrc-panels-using-xrcise/145660 "2008-08-12T17:32:10Z")\
**Posts on this page:** 2\
**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:** [August 12, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/xrc-panels-using-xrcise/145660/1 "2008-08-12T17:32:10Z")

</div>

Hi all,  
I’m facing a problem generating base classes using xrcise.

i’ve this xrc layout:

\<?xml version="1.0" encoding="UTF-8"?\> wxCAPTION|wxRESIZE\_BORDER|wxSYSTEM\_MENU|wxMINIMIZE\_BOX|wxCLOSE\_BOX|wxFULL\_REPAINT\_ON\_RESIZE

```
    <size>300,400</size>
    <title>wxnc</title>
    <object class="wxMenuBar" name="ID_MENUBAR">
        <object class="wxMenu">
            <label>File</label>
            <object class="wxMenuItem" name="ID_CONNETTI_MENU_ITEM">
                <label>Connetti</label>
            </object>
            <object class="separator">
            </object>
            <object class="wxMenuItem" name="wxID_EXIT">
                <label>Esci</label>
            </object>
        </object>
    </object>
    <object class="wxNotebook" name="ID_NOTEBOOK" 

```

subclass=“notebook”\>  
wxRAISED\_BORDER  
  
Contatti  
  
wxSUNKEN\_BORDER|wxTAB\_TRAVERSAL  
  
  
  
Configurazione  
  
wxSUNKEN\_BORDER|wxTAB\_TRAVERSAL

…as the xrcise  
tutorial[http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise](http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise)say:

" Note that whereas the “Class” field of top-level Frames, Dialogs and  
Panels will become Ruby _classes_, for the controls within a container,  
the  
“Class” field is the name of a Ruby _module_ used to extend the  
control."

but no classes are generated for the two panels inside wxNotebook  
(contatti  
and config)

Is there any options to force panel class generation?

My platform is ubuntu 7.x - Ruby 1.8.5 - wxruby 1.9.7 - wx\_sugar 0.1.20

thank you.

f.

---

<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:** [August 12, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/xrc-panels-using-xrcise/145660/2 "2008-08-12T18:56:43Z")

</div>

Hi Fabio

Fabio P. wrote:

> container, the “Class” field is the name of a Ruby _module_ used to  
> extend the control."
> 
> but no classes are generated for the two panels inside wxNotebook  
> (contatti and config)
> 
> Is there any options to force panel class generation?

It doesn’t really work this way. The class always corresponds to a  
top-level element in the XRC - in this case, your frame. This limitation  
comes from WxWidgets. This base class is generated by XRCise.

To link ruby code behaviours to contained elements - like your panels -  
you write a ruby a module with the same name as the ‘subclass’ attribute  
in the XRC. Then, when the whole layout is loaded from XRC, the elements  
will be extend-ed with that module.

hth  
alex
