selection color for wx.grid.Grid (on linux)

I have an app which populates a grid and selects row 0 on startup.

The problem is that the selected row is shown as having a grey background.

Once I select the right (left-mouse) it turns into the correct orange color (rgba(240, 119, 70, 0.902)).

Is there someway I can have the correct color shown even before selecting the row with the mouse?

Also, once I load the grid if I left-click the column label area (above the grid data) before I select a row I get this message on the console:

*** BUG ***

In pixman_region32_init_rect: Invalid rectangle passed

Set a breakpoint on ‘_pixman_log_error’ to debug

Using 4.0.4, Ubuntu 18.02 and python 2.7. Unfortunately the app is large so coming up with a simple .py to demonstrate the problem is not easy.

I have an app which populates a grid and selects row 0 on startup.

The problem is that the selected row is shown as having a grey background.

Once I select the right (left-mouse) it turns into the correct orange color (rgba(240, 119, 70, 0.902)).

Is there someway I can have the correct color shown even before selecting the row with the mouse?

It sounds like the difference between the grid having the keyboard focus or not. Have you tried calling the grid’s SetFocus method? (Perhaps via wx.CallAfter to delay it until the next iteration of the event loop.)

Also, once I load the grid if I left-click the column label area (above the grid data) before I select a row I get this message on the console:

*** BUG ***

In pixman_region32_init_rect: Invalid rectangle passed

Set a breakpoint on ‘_pixman_log_error’ to debug

Using 4.0.4, Ubuntu 18.02 and python 2.7. Unfortunately the app is large so coming up with a simple .py to demonstrate the problem is not easy.

GTK is very nitpicky about warnings and errors, and it seems to change on every release. So it’s usually okay to just ignore the messages.

···

On Friday, April 19, 2019 at 12:35:05 PM UTC-7, Demetrios Tsillas wrote:

Robin

Is there a way to suppress this warning so it doesn’t show up in the console?

···

On Mon, Apr 22, 2019 at 11:27 AM Robin Dunn robin@alldunn.com wrote:

On Friday, April 19, 2019 at 12:35:05 PM UTC-7, Demetrios Tsillas wrote:

I have an app which populates a grid and selects row 0 on startup.

The problem is that the selected row is shown as having a grey background.

Once I select the right (left-mouse) it turns into the correct orange color (rgba(240, 119, 70, 0.902)).

Is there someway I can have the correct color shown even before selecting the row with the mouse?

It sounds like the difference between the grid having the keyboard focus or not. Have you tried calling the grid’s SetFocus method? (Perhaps via wx.CallAfter to delay it until the next iteration of the event loop.)

Also, once I load the grid if I left-click the column label area (above the grid data) before I select a row I get this message on the console:

*** BUG ***

In pixman_region32_init_rect: Invalid rectangle passed

Set a breakpoint on ‘_pixman_log_error’ to debug

Using 4.0.4, Ubuntu 18.02 and python 2.7. Unfortunately the app is large so coming up with a simple .py to demonstrate the problem is not easy.

GTK is very nitpicky about warnings and errors, and it seems to change on every release. So it’s usually okay to just ignore the messages.

Robin

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

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxPython-dev/AtqQwdMbSjY/unsubscribe.

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

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