windows vs MacOS related to wx.grid and GLCanvas

Hello,

So I have a couple of problems when trying to port my program from MacOS
to windows. The first one is related to a wx.grid. I have a grid with a
custom cell renderer and I wanted to do a custom menu that displays
aside a table cell when clicked on. So I created a panel with some
components and on a left click I just do:

position = event.GetPosition()
grid_pos = self.GetParent().GetPosition()
x_pos = position[0] + grid_pos[0]
y_pos = position[1] + grid_pos[1]
grid_size = self.GetSize()
info_size = self.info_panel.GetSize()
if position[0] + info_size[0] > grid_size[0]:
x_pos = x_pos - info_size[0]
if position[1] + info_size[1] > grid_size[1]:
y_pos = y_pos - info_size[1]
self.info_panel.Update()
self.info_panel.Refresh()
self.info_panel.SetPosition((x_pos, y_pos))
self.info_panel.Raise()
self.info_panel.Show()

Now this works perfectly on MacOS. However on windows I click on a cell,
the panel raises on top and is shown but immediately after the wx.grid
seems to take the focus and the panel is pushed back behind it. What is
the cause of this behaviour and can it be fixed?

Please make a small runnable sample that shows this problem so others can experiment with it.

The second problem is with a color picking scheme done using OpenGL. I
draw every object in a different color and use glReadPixels(x, y, 1, 1,
GL_RGB, GL_UNSIGNED_BYTE) to get the clicked object color. Now again
this works perfectly on MacOS, and on a WebGL implementation(the webgl
part works both on windows and on mac, that's why I tought something
related to wx might be the problem) but on windows that call always
returns (0, 0, 0). Is there some difference in the way OpenGL is
integrated by wx between windows and macos ?

I don't know. I haven't ever worked on or even looked at that code much, but my understanding is that it simply uses some native functions to create the GL context and associate it with the window. Everything else you do with it is directly using the OpenGL library APIs.

···

On 1/16/12 12:46 AM, Neacsa Bogdan Valentin wrote:

--
Robin Dunn
Software Craftsman

we've got color pickcing done like this on a app that works both on
Windows and OS-X -- but I'd need to dig some to find the code.

I'd ask on the pyOpenGL list.

Also -- have you tried more than one Windows box? It could be an
OpenGL driver issue, rather than a Windows one.

-Chris

···

On Mon, Jan 16, 2012 at 3:22 PM, Robin Dunn <robin@alldunn.com> wrote:

On 1/16/12 12:46 AM, Neacsa Bogdan Valentin wrote:

The second problem is with a color picking scheme done using OpenGL.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov