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