[wxPython-users] Scrolling text overlay

Andrea Gavana andrea.gavana at gmail.com
Tue Apr 3 13:13:04 PDT 2007


Hi Mike,

On 4/3/07, Mike Rooney wrote:
> What I need to do is figure out the pixel width of the text I am
> scrolling, and if the textOffset == textWidth, stop the timer. Any idea
> of how to do this? You will see my comment at the bottom of the onTimer
> method in the attached runnable sample. Thanks for all your help so far!

wx.MemoryDC (like all the other DCs I think), provides methods like:

width, height = dc.GetTextExtent()
width = dc.GetCharWidth()

So, before destroying the DC, you can call one of the two
aforementioned methods to get your text width.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/




More information about the wxpython-users mailing list