I am trying to add a wxGrid to my gui using XRCed. I am running XRCed 0.2.1-0 and wxPython 2.9.4 on OSX 10.8.4.
In the XRCed dialog I see an icon of something that looks like a wxGrid. This code gets added to my xrc file:
<object class="sizeritem">
<object class="wxGrid" name="params_grid"/>
</object>
I have this code in my OnInit method:
self.params_grid = xrc.XRCCTRL(self.frame, "params_grid")
self.params_grid.CreateGrid(10,2)
and it leads to this traceback:
rkrauss>DT_TMM_gui$ python test_ryans_first_xrc.py
loading ryans_first_xrc.xrc
Traceback (most recent call last):
File “test_ryans_first_xrc.py”, line 139, in
app = MyApp(0)
File “/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa/wx/_core.py”, line 8631, in init
self._BootstrapApp()
File “/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa/wx/_core.py”, line 8196, in _BootstrapApp
return core.PyApp__BootstrapApp(*args, **kwargs)
File “test_ryans_first_xrc.py”, line 118, in OnInit
self.params_grid.CreateGrid(10,2)
AttributeError: ‘ScrolledWindow’ object has no attribute ‘CreateGrid’
which seems to imply that my wxGrid is really a ScrolledWindow. What am I doing wrong here?
I am attaching the xrc and py files.
Thanks,
Ryan
test_ryans_first_xrc.py (4.17 KB)
ryans_first_xrc.xrc (1.48 KB)