Thanks for any suggestion
Below is my code
def _OnPaint(self, evt):
dc = wx.BufferedPaintDC(self)
self.DoPrepareDC(dc)
dc.Clear()
nLeft, nTop = self.GetViewStart()
print nLeft, nTop
dc.DrawText('hello', nLeft + 100, nTop)
Don't draw the text. Just use a wx.StaticText widget. Put the ScrolledWindow into a sizer and then add the static text widget. Voila! You're done!
If you want to go the drawing route, then you will have to bind to the scrolling events and figure out where in the scrolled area you are. Then re-draw the text whenever the scrollwheel stops. This will be a LOT more work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.