Ticket #4272 (confirmed defect)

Opened 6 years ago

Last modified 8 months ago

"CGContextRestoreGState: invalid context" from STC

Reported by: dan-sg Owned by: robind
Priority: low Milestone:
Component: wxStyledText Version:
Keywords: Cc: dan-sg, robind
Blocked By: Patch: no
Blocking:

Description

platform: mac os x 10.4.9
python: 2.5
wxpython: 2.8.3.0

Setting the status bar from inside wx.stc.EVT_STC_PAINTED handler causes "CGContextRestoreGState: invalid context" to be printed.

In the attached example, it only happens once, in the beginning, but I had a larger example where it kept on happening.

Using wx.CallAfter made the problem go away.

Attachments

bug.py download (0.7 KB) - added by dan-sg 6 years ago.
script showing the bug

Change History

Changed 6 years ago by dan-sg

Changed 6 years ago by dan-sg

File Added: bug.py

Changed 6 years ago by dan-sg

script showing the bug

Changed 5 years ago by wxsite

  • status changed from assigned to confirmed

transitioning old 'assigned' status to new 'confirmed' status

Changed 5 years ago by vadz

  • priority changed from normal to low

Lowing priority as there is a simple workaround.

It would still be nice to understand what's going on here, of course.

Changed 8 months ago by dpage

  • priority changed from low to normal

This also affects C++ where it cannot be worked around with wx.CallAfter.

Changed 8 months ago by vadz

  • priority changed from normal to low

In general it's a pretty bad idea to do anything other than painting the window from EVT_PAINT so I don't think it's a high priority to fix it.

Also, does it happen in 2.9.4 with wxOSX/Cocoa or is Carbon-specific?

Note: See TracTickets for help on using tickets.