Opened 7 years ago

Last modified 19 months 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

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 (1)

bug.py download (681 bytes) - added by dan-sg 7 years ago.
script showing the bug

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by dan-sg

script showing the bug

comment:1 Changed 7 years ago by dan-sg

File Added: bug.py

comment:2 Changed 6 years ago by wxsite

  • Status changed from assigned to confirmed

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

comment:3 Changed 6 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 19 months 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 19 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.