# Xrc file and WxGrid

**URL:** <https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380>\
**Category:** wxRuby\
**Created:** [March 19, 2009, 7:13pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380 "2009-03-19T19:13:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 19, 2009, 7:13pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/1 "2009-03-19T19:13:49Z")

</div>

Has anyone any experience with using a XRC file that setsup a Wx::Grid?

I’m using wxFormBuilder, in which I setup a grid in a boxsizer, with  
column names and all. But when I render it via Ruby the grid is just a  
small empty gray box, and I can’t seem to manipulate it at all. I  
tried adding columns, resizing columns, populating it with data, etc.  
but still nothing.

I look at the XRC file and see that this is all it is:

 1 wxALL 5 

Does XRC not handle Wx::Grid properties?

~Trans.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 19, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/2 "2009-03-19T19:49:44Z")

</div>

No, wxWidgets and further more wxRuby can use just about any control  
defined  
through XRC. There’s not much we can tell from that snippet you gave  
us.  
Could you attach both the XRC and the Ruby files your using to attempt  
to  
load the Window, with the Grid, that shows the problem of it not  
working,  
and also please mention what Platform, and Version of Ruby/wxRuby you  
are  
attempting to use.

Thanks,

~ Mario

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 19, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/3 "2009-03-19T21:10:46Z")

</div>

2009/3/19 Mario S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> No, wxWidgets and further more wxRuby can use just about any control defined  
> through XRC.Â There’s not much we can tell from that snippet you gave us.  
> Could you attach both the XRC and the Ruby files your using to attempt to  
> load the Window, with the Grid, that shows the problem of it not working,  
> and also please mention what Platform, and Version of Ruby/wxRuby you are  
> attempting to use.
> 
> Thanks,
> 
> ~ Mario

Sure thing. I’m running:

Ubuntu 8.04 64-bit (everything is installed via apt-get or rubygems)  
WxFormBuilder 3.0.57 (unicode)  
ruby 1.8.6 (2007-09-24 patchlevel 111) [x86\_64-linux]  
wxruby-2.0.0-x86\_64-linux

Attached are the files. There are some support files missing so it  
won’t run straight away, but remarking out the epony and @client stuff  
in on\_init should do the trick.

Also, the fbp file might need the search.gif file in an images/  
directory to load.

HTH,  
T.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 20, 2009, 7:09pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/4 "2009-03-20T19:09:17Z")

</div>

FYI. I’ve given up on the XRC file. I went back to doing it all by  
hand. Using WxFormBuilder in the interm did help me understand the  
controls better though. So that’s a good thing.

So, I finally got my UI working like I want it too. I’m going to blog  
about it and demonstrate the bottom up technique I worked out that  
makes it much easier to design the interface using wxRuby.

Thanks for the help,  
T.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 21, 2009, 1:18am UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/5 "2009-03-21T01:18:16Z")

</div>

On Fri, Mar 20, 2009 at 6:52 PM, Scott thorpe [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > T.
> 
> I’m sorry. But its kinda funny after opening the files you attached. I  
> had to giggle.
> 
> Just curious. Did you run xrcise ?

I did --once I figured out how to set the subclass of the main frame.  
But that blew out with an error too. I’ve attached it. It’s not much  
different then what I tried by hand.

T.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 20, 2009, 11:52pm UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/6 "2009-03-20T23:52:19Z")

</div>

Thomas S. wrote:

> FYI. I’ve given up on the XRC file. I went back to doing it all by  
> hand. Using WxFormBuilder in the interm did help me understand the  
> controls better though. So that’s a good thing.
> 
> So, I finally got my UI working like I want it too. I’m going to blog  
> about it and demonstrate the bottom up technique I worked out that  
> makes it much easier to design the interface using wxRuby.
> 
> Thanks for the help,  
> T.

I’m sorry. But its kinda funny after opening the files you attached. I  
had to giggle.

Just curious. Did you run xrcise ?

–Scott

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [March 21, 2009, 1:20am UTC](https://www.ruby-forum.com/t/xrc-file-and-wxgrid/163380/7 "2009-03-21T01:20:02Z")

</div>

On Fri, Mar 20, 2009 at 8:14 PM, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Thanks for the help,  
> > > T.
> > 
> > I’m sorry. But its kinda funny after opening the files you attached. I  
> > had to giggle.

The whole thing would be hysterical if it wasn’t such a pain in my  
butt!!! 😉

T.
