wx.Pen styles using GraphicsContext on GTK

Hello all,

I am having some issues when I use wx.SHORT_DASH, wx.LONG_DASH or
wx.DOT_DASH as the wx.Pen style on a GraphicsContext when on a GTK
platform. Basically any application or script hangs when using these
styles. The other styles such as solid or transparent work fine.

I have tried this on Ubuntu 10.04 64-bit, using the default wxPython
2.8.10.1 and on Ubuntu 10.10 64-bit, using the default wxPython
2.8.11.0. It completely hangs on the former, and takes several seconds
to load on the latter. The end result on 2.8.11.0 using wx.SHORT_DASH,
wx.LONG_DASH or wx.DOT_DASH produces the same style as wx.SOLID.

I cannot replicate this issue on Mac OS X 10.6 or on Windows 7 64-bit
using wxPython 2.8.10.1.

I was able to test this using the wxPython 2.8.10.1 demo by changing
line 51 (or in wxPython 2.8.11.0 demo, line 90) in the GraphicsContext
demo from:

        gc.SetPen(wx.Pen("navy", 1))
to
        gc.SetPen(wx.Pen("navy", style=wx.SHORT_DASH)) # doesn't work
but
        gc.SetPen(wx.Pen("navy", style=wx.TRANSPARENT)) # works as
expected

Is it possible that GTK doesn't have these styles defined? I know on
Windows, wx.SHORT_DASH and wx.LONG_DASH produce the same effect.

Thanks,

Adit

I ended up just using an if statement to disable these styles on GTK.

If anyone has a solution or has run into this issue before, I would
appreciate it.

Thanks,

Adit

···

On Feb 15, 1:01 pm, Adit Panchal <apanchal...@bastula.org> wrote:

Hello all,

I am having some issues when I use wx.SHORT_DASH, wx.LONG_DASH or
wx.DOT_DASH as the wx.Pen style on a GraphicsContext when on a GTK
platform. Basically any application or script hangs when using these
styles. The other styles such as solid or transparent work fine.

I have tried this on Ubuntu 10.04 64-bit, using the default wxPython
2.8.10.1 and on Ubuntu 10.10 64-bit, using the default wxPython
2.8.11.0. It completely hangs on the former, and takes several seconds
to load on the latter. The end result on 2.8.11.0 using wx.SHORT_DASH,
wx.LONG_DASH or wx.DOT_DASH produces the same style as wx.SOLID.

I cannot replicate this issue on Mac OS X 10.6 or on Windows 7 64-bit
using wxPython 2.8.10.1.

I was able to test this using the wxPython 2.8.10.1 demo by changing
line 51 (or in wxPython 2.8.11.0 demo, line 90) in the GraphicsContext
demo from:

    gc\.SetPen\(wx\.Pen\(&quot;navy&quot;, 1\)\)

to
gc.SetPen(wx.Pen("navy", style=wx.SHORT_DASH)) # doesn't work
but
gc.SetPen(wx.Pen("navy", style=wx.TRANSPARENT)) # works as
expected

Is it possible that GTK doesn't have these styles defined? I know on
Windows, wx.SHORT_DASH and wx.LONG_DASH produce the same effect.

Thanks,

Adit