Christopher Barker wrote:
Barry Scott wrote:
The reason I'm porting to wxPython to to escape from all the platform specific and very old code I have at the moment.
well, there are till some platform issues with wx, but very very few where there is not one way that will work on all platforms. For the most part, what you find is that the "recommended" way works everywhere, and some not-recommended ways will work only on some. So once you find the right solution, you don't have platform specific code.>> If there's sample code out there
using ClientDC for drawing the UI instead, I'd hope whoever wrote / maintains it would go and fix it.
Guilty as charged (probably). I'll try to see what I can do to update the Wiki, etc.FWIW, I'll bet there's stuff in the Demo that uses ClientDC
This seems to have things working well enough. (I still have to solve the problems with performance with needing to call DrawText for every
> char on the screen).
It seems that you probably would want to keep track of what has changed and what hasn't anyway, but I guess it is more of a pain than just re-drawing everything every time.
good luck,
-CHB
IIRC, I had troubles with drawing on a ScrolledPanel if I don't use the following code (to "get" a drawable DC -- self in this case refers to a scrollpanel instance)
def get_dc(self):
cdc = wx.ClientDC(self)
self.PrepareDC(cdc)
return wx.BufferedDC(cdc, self.buffer, wx.BUFFER_VIRTUAL_AREA)
as well as a mixture of ScrolledPanel.RefreshRect
I'm not sure how I'd go about converting to a clientDC-less code base.
···
--
Steven Sproat, BSc
http://www.basicrpg.com/