wx 2.9.1.1 strange behavior with wx.SUNKEN_BORDER

This is just a report more than anything, but I would love to know if there is a workaround for this…or just that someone else can confirm this.

There appear to be drawing errors under certain flavors of Linux when a panel has the wx.SUNKEN_BORDER, wx.RAISED_BORDER, or wx.DOUBLE_BORDER style. I can see this behavior under Ubuntu 10.10 and Linux Mint Debian, which both are running a recent version of GNOME. I don’t see it on my SuSe 11.1 test box, which runs KDE, although on that system, the window starts acting a little funny if you continue to resize it.

Sample code is attached. Basically, the buttons disappear as the window is resized. There are other drawing errors that are harder to demonstrate with a little code like this, but I’ve confirmed that if I go through all of my dialogs and make sure that there are no sunken borders (I had used them all over the place), I have no drawing errors.

Or maybe I’m just doing something wrong, in which case some kind soul might point it out :wink:

sample.py (1.25 KB)

···


Daniel Hyams
dhyams@gmail.com

I have already created a ticket for this (similar) issue. It was supposedly fixed in wxWidgets, so you’ll see the fixed wxPython version when there’s a new wxWidgets version. 'Till then, roll back to wxPython 2.8.11.

P.S.: When I resize the window of your sample app, the buttons don’t disappear for me. They stay in the same place as they are. Using Windows 7 Home Premium Service Pack 1 64-bit, Python 2.7.1 and wxPython 2.8.11. I don’t know whether the issue would arise if I install wxPython 2.9.1.1, but I think it would. I had similar issues with the status bar, so something must have been broken in that part of the GUI toolkit.

Thanks Bostjan:

This behavior is specific to 2.9.1.1 only on recent Linux distros that
use GNOME. I'll search the trac for the ticket to see if it matches
up to what I'm seeing.

···

On Mar 16, 11:42 am, Boštjan Mejak <bostjan.me...@gmail.com> wrote:

I have already created a ticket for this (similar) issue. It was supposedly
fixed in wxWidgets, so you'll see the fixed wxPython version when there's a
new wxWidgets version. 'Till then, roll back to wxPython 2.8.11.

P.S.: When I resize the window of your sample app, the buttons don't
disappear for me. They stay in the same place as they are. Using Windows 7
Home Premium Service Pack 1 64-bit, Python 2.7.1 and wxPython 2.8.11. I
don't know whether the issue would arise if I install wxPython 2.9.1.1, but
I think it would. I had similar issues with the status bar, so something
must have been broken in that part of the GUI toolkit.

This ticket looks like it;

http://trac.wxwidgets.org/ticket/11690

Looking at the possible fix, I doubt that it will, but I'll give it a
shot; it was easier to see in my regular application that it wasn't so
much that the border wasn't getting drawn, it was that a gray patch
the size of the panel was always getting drawn at 0,0 over the top of
everything.

···

On Mar 16, 12:57 pm, dhyams <dhy...@gmail.com> wrote:

Thanks Bostjan:

This behavior is specific to 2.9.1.1 only on recent Linux distros that
use GNOME. I'll search the trac for the ticket to see if it matches
up to what I'm seeing.

On Mar 16, 11:42 am, Boštjan Mejak <bostjan.me...@gmail.com> wrote:

> I have already created a ticket for this (similar) issue. It was supposedly
> fixed in wxWidgets, so you'll see the fixed wxPython version when there's a
> new wxWidgets version. 'Till then, roll back to wxPython 2.8.11.

> P.S.: When I resize the window of your sample app, the buttons don't
> disappear for me. They stay in the same place as they are. Using Windows 7
> Home Premium Service Pack 1 64-bit, Python 2.7.1 and wxPython 2.8.11. I
> don't know whether the issue would arise if I install wxPython 2.9.1.1, but
> I think it would. I had similar issues with the status bar, so something
> must have been broken in that part of the GUI toolkit.

I agree, that is the way it looks to me as well. It also happens in my recent snapshot from trunk so the changeset mentioned there has had no effect on this problem. You should create a new ticket about this.

···

On 3/16/11 10:09 AM, dhyams wrote:

This ticket looks like it;

wxTrac has been migrated to GitHub Issues - wxWidgets

Looking at the possible fix, I doubt that it will, but I'll give it a
shot; it was easier to see in my regular application that it wasn't so
much that the border wasn't getting drawn, it was that a gray patch
the size of the panel was always getting drawn at 0,0 over the top of
everything.

--
Robin Dunn
Software Craftsman

Done:

http://trac.wxwidgets.org/ticket/13069

In the meantime, I have worked around this problem by taking over the
sunken border drawing myself:

def DrawSunkenBorder(drawDC):
      drawDC.SetPen(wx.Pen(wx.Colour(128,128,128),1))
      sz = drawDC.GetSize()
      drawDC.DrawLine(0,0,0,sz[1]) # left line outside
      drawDC.DrawLine(0,0,sz[0],0) # top line outside
      drawDC.SetPen(wx.Pen(wx.BLACK,1))
      drawDC.DrawLine(1,1,1,sz[1]) # left line inside
      drawDC.DrawLine(1,1,sz[0],1) # top line inside
      drawDC.SetPen(wx.Pen(wx.Colour(192,192,192),1))
      drawDC.DrawLine(sz[0]-1,1,sz[0]-1,sz[1])
      drawDC.DrawLine(sz[0]-1,sz[1]-1,1,sz[1]-1)

···

On Mar 17, 3:41 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 3/16/11 10:09 AM, dhyams wrote:

> This ticket looks like it;

>wxTrac has been migrated to GitHub Issues - wxWidgets

> Looking at the possible fix, I doubt that it will, but I'll give it a
> shot; it was easier to see in my regular application that it wasn't so
> much that the border wasn't getting drawn, it was that a gray patch
> the size of the panel was always getting drawn at 0,0 over the top of
> everything.

I agree, that is the way it looks to me as well. It also happens in my
recent snapshot from trunk so the changeset mentioned there has had no
effect on this problem. You should create a new ticket about this.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org