From: John H. <jdh...@ac...> - 2003-12-02 18:30:36
|
>>>>> "Jeremy" == Jeremy O'Donoghue <je...@o-...> writes: Jeremy> I have attached the updated backend_wx.py. Obviously if Jeremy> I've broken wxGTK I'll need to look into it as a matter of Jeremy> urgency. Probably is a GTK2 thing. Do you have access to a GTK2 machine to test? Jeremy> This sounds worryingly as though you do have the latest Jeremy> version (there was no file save dialog code at all until Jeremy> this morning). Yep, same problem with the attached code. Jeremy> In particular, the behaviour of a wxMemoryDC (which is the Jeremy> context used to draw into the bitmap) seems quite Jeremy> different between the two platforms. The main bug I've had Jeremy> to deal with is that the bitmap can only be selected into Jeremy> a single wxMemoryDC at a time. This means that I have to Jeremy> take explicit care to ensure that whenever a Jeremy> GraphicsContextWx.new_gc() is called, I explicitly ensure Jeremy> that the bitmap is selected from the last wxMemoryDC. I diagnosed why the print code doesn't save a file. It hangs indefinitely on the call to gc = self.drawable.new_gc() Jeremy> The other thing to look for is in the _onSize and _onPaint Jeremy> methods of FigureWx: the image from the bitmap is sent to Jeremy> the screen with a Blit() call. This seems to be necessary Jeremy> on Windows as the (simpler, but equivalent) DrawBitmap() Jeremy> call does not work properly. Tried Blit versus DrawBitmap in both. No help Jeremy> Where the printing is concerned, again, you could try Jeremy> uncommenting the 'self.bitmap.SaveFile()' line, which Jeremy> checks whether it is possible to save a 'known good' Jeremy> bitmap. No help, due to the hang on new_gc Any other ideas? JDH |