Opened 13 years ago

Last modified 8 years ago

#4272 confirmed defect

"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: Blocking:
Patch: no


platform: mac os x 10.4.9
python: 2.5

Setting the status bar from inside 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 (1) download (681 bytes) - added by dan-sg 13 years ago.
script showing the bug

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by dan-sg

script showing the bug

comment:1 Changed 13 years ago by dan-sg

File Added:

comment:2 Changed 12 years ago by wxsite

  • Status changed from assigned to confirmed

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

comment:3 Changed 12 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.

comment:4 Changed 8 years ago by dpage

  • Priority changed from low to normal

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

comment:5 Changed 8 years 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.