Unknown style flag wxVSCROLL -- error

To separate the view and control I started using xrc.

ERROR: Unknown style flag wxVSCROLL

self.m_grid = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL )

The above code works fine (If I don’t use XRC)

wxHSCROLL|wxVSCROLL

While loading this object using XRC, its showing that error

------- I’m using
Python 2.7.5
wxPython 2.8.12

Can you pl help me in solving this.

Regards,
Vijay Bharath Reddy

విజయ్ భరత్ wrote:

To separate the view and control I started using xrc.

ERROR: Unknown style flag wxVSCROLL

self.m_grid = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition,
wx.DefaultSize, wx.HSCROLL|wx.VSCROLL )

The above code works fine (If I don't use XRC)

<object class="wxGrid" name="m_grid">
<style>wxHSCROLL|wxVSCROLL</style>
</object>

While loading this object using XRC, its showing that error

------- I'm using
Python 2.7.5
wxPython 2.8.12

Can you pl help me in solving this.

Those styles are added for all window types in XRC so I'm not sure what might be causing the problem. However, you really shouldn't need them with wxGrid because scrolling will automatically be enabled when needed to be able to display all the cells.

···

--
Robin Dunn
Software Craftsman

Thanks Robin.

Can you recommend a site or material with information on XRC in more detail (like the demo in wxPython which is really helpful)

I checked the wiki too. They have only one or two examples.

Regards,
Vijay Bharath Reddy

···

On Monday, July 22, 2013 10:39:36 PM UTC+5:30, Robin Dunn wrote:

విజయ్ భరత్ wrote:

To separate the view and control I started using xrc.

ERROR: Unknown style flag wxVSCROLL

self.m_grid = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition,

wx.DefaultSize, wx.HSCROLL|wx.VSCROLL )

The above code works fine (If I don’t use XRC)

wxHSCROLL|wxVSCROLL

While loading this object using XRC, its showing that error

------- I’m using

Python 2.7.5

wxPython 2.8.12

Can you pl help me in solving this.

Those styles are added for all window types in XRC so I’m not sure what
might be causing the problem. However, you really shouldn’t need them
with wxGrid because scrolling will automatically be enabled when needed
to be able to display all the cells.


Robin Dunn

Software Craftsman

http://wxPython.org

Hi,

···

On Monday, July 22, 2013 8:19:04 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Robin.

Can you recommend a site or material with information on XRC in more detail (like the demo in wxPython which is really helpful)

I checked the wiki too. They have only one or two examples.

Regards,
Vijay Bharath Reddy

I wrote a tutorial on XRC a while ago that contains several links to other resources. It might help you a little: wxPython: An Introduction to XRC - Mouse Vs Python

Oh, I wrote this too: wxPython: An XRCed Tutorial - Mouse Vs Python

Hope that helps!
Mike

Thanks Mike.

Do you have an example on wxGrid (general table) with XRC + XRCed?

···

On Tuesday, July 23, 2013 7:55:15 PM UTC+5:30, Mike Driscoll wrote:

Hi,

On Monday, July 22, 2013 8:19:04 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Robin.

Can you recommend a site or material with information on XRC in more detail (like the demo in wxPython which is really helpful)

I checked the wiki too. They have only one or two examples.

Regards,
Vijay Bharath Reddy

I wrote a tutorial on XRC a while ago that contains several links to other resources. It might help you a little: http://www.blog.pythonlibrary.org/2010/05/11/wxpython-an-introduction-to-xrc/

Oh, I wrote this too: http://www.blog.pythonlibrary.org/2010/10/28/wxpython-an-xrced-tutorial/

Hope that helps!
Mike

Hi,

xrcGridDemo.py (648 Bytes)

grid.xrc (211 Bytes)

···

On Tuesday, July 23, 2013 1:25:22 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Mike.

Do you have an example on wxGrid (general table) with XRC + XRCed?

Well, theoretically, the attached should work. However, when I try to pull the XRCCTRL is somehow changing my wx.Grid into a ScrolledWindow. Maybe Robin or someone else can see what’s happening. The XRC code looks right, but I’m getting the wrong widget.

  • Mike

I, too, am facing the same problem with the wxGrid changing to
ScrolledWindow while loading from xrc.

···

On Wed, Jul 24, 2013 at 2:39 AM, Mike Driscoll <kyosohma@gmail.com> wrote:

Hi,

On Tuesday, July 23, 2013 1:25:22 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Mike.

Do you have an example on wxGrid (general table) with XRC + XRCed?

Well, theoretically, the attached should work. However, when I try to pull
the XRCCTRL is somehow changing my wx.Grid into a ScrolledWindow. Maybe
Robin or someone else can see what's happening. The XRC code looks right,
but I'm getting the wrong widget.

- Mike

I took a look in the wx archive, and this one’s been posed before, with a solution from Robin:

*You need to import wx.grid in your python code. When you do that then
some internal data structures are updated with the type info for the
grid classes, and this info is used when figuring out how to convert a
C++ pointer to a Python object of the right typ for the XRCCTRL return
value. *

Mike, I tried it out on your example (inserted an import wx.grid after the import wx statement) and it worked like a champ.

···

On Tue, Jul 23, 2013 at 8:59 PM, Vijay Bharath Reddy vijaybharathenator@gmail.com wrote:

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

On Wed, Jul 24, 2013 at 2:39 AM, Mike Driscoll kyosohma@gmail.com wrote:

Hi,

On Tuesday, July 23, 2013 1:25:22 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Mike.

Do you have an example on wxGrid (general table) with XRC + XRCed?

Well, theoretically, the attached should work. However, when I try to pull the XRCCTRL is somehow changing my wx.Grid into a ScrolledWindow. Maybe Robin or someone else can see what’s happening. The XRC code looks right, but I’m getting the wrong widget.

  • Mike

I, too, am facing the same problem with the wxGrid changing to ScrolledWindow while loading from xrc.

Yeah, its working after that import statement. I somehow missed that post.

Thanks Edoc

···

- విజయ్ భరత్ రెడ్డి

On Wed, Jul 24, 2013 at 9:19 AM, edoc e.doxtator@gmail.com wrote:

I took a look in the wx archive, and this one’s been posed before, with a solution from Robin:

*You need to import wx.grid in your python code. When you do that then
some internal data structures are updated with the type info for the
grid classes, and this info is used when figuring out how to convert a
C++ pointer to a Python object of the right typ for the XRCCTRL return
value. *

Mike, I tried it out on your example (inserted an import wx.grid after the import wx statement) and it worked like a champ.

You received this message because you are subscribed to a topic in the Google Groups “wxPython-users” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/IfjW9f7LEhQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

On Tue, Jul 23, 2013 at 8:59 PM, Vijay Bharath Reddy vijaybharathenator@gmail.com wrote:

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

On Wed, Jul 24, 2013 at 2:39 AM, Mike Driscoll kyosohma@gmail.com wrote:

Hi,

On Tuesday, July 23, 2013 1:25:22 PM UTC-5, విజయ్ భరత్ wrote:

Thanks Mike.

Do you have an example on wxGrid (general table) with XRC + XRCed?

Well, theoretically, the attached should work. However, when I try to pull the XRCCTRL is somehow changing my wx.Grid into a ScrolledWindow. Maybe Robin or someone else can see what’s happening. The XRC code looks right, but I’m getting the wrong widget.

  • Mike

I, too, am facing the same problem with the wxGrid changing to ScrolledWindow while loading from xrc.

edoc wrote:

I took a look in the wx archive, and this one's been posed before, with
a solution from Robin
<http://wxpython-users.1045709.n5.nabble.com/xrc-wxGrid-problems-fetching-widget-using-XRCCTRL-td2363160.html&gt;:

/You need to import wx.grid in your python code. When you do that then
some internal data structures are updated with the type info for the
grid classes, and this info is used when figuring out how to convert a
C++ pointer to a Python object of the right typ for the XRCCTRL return
value. /
/

Yeah, what he said. :wink:

···

--
Robin Dunn
Software Craftsman

Hi,

···

On Tuesday, July 23, 2013 10:49:48 PM UTC-5, edoxtator wrote:

I took a look in the wx archive, and this one’s been posed before, with a solution from Robin:

*You need to import wx.grid in your python code. When you do that then
some internal data structures are updated with the type info for the
grid classes, and this info is used when figuring out how to convert a
C++ pointer to a Python object of the right typ for the XRCCTRL return
value. *

Mike, I tried it out on your example (inserted an import wx.grid after the import wx statement) and it worked like a champ.

Good catch. I missed that too. I’ll be posting a little article about this on my blog later today so it’s easier to find next time…

Thanks!

  • Mike