Flickering ScrolledWindow

Can't help on the actual problem, but I wonder if wx.lib.floatcanvas or floatcanvas 2 (http://trac.paulmcnett.com/floatcanvas , GSoC2008/FloatCanvasRefactor - wxPyWiki ) or wx.lib.ogl wouldn't be a better start for something like a drawing window/app?

Werner

···

On 30/06/2010 10:17, Federico Fanton wrote:

Hi everyone!

I'm trying to build a ScrolledWindow that you can draw on using the mouse, and it's working too, but I'm getting a nasty flicker when the user is drawing on the window while the scrollbars aren't in the "home" position..

To reproduce, run the attached program, scroll a bit down (or to the right) and "doodle" a bit by keeping the left mouse button pressed. You should see a flickering now and then..

I tried using SetBackgroundStyle(wx.BG_STYLE_CUSTOM), or binding EVT_ERASE_BACKGROUND, or using RefreshRect instead of Refresh, but the flicker is still there.. Any idea on what I might try next?

Well I think I *could* use FloatCanvas.. I haven't used it before
though, does it allow for scrollbars or is it supposed to work with
the zooming/panning toolbar, without scrollbars?

Thanks for chiming in btw :slight_smile:

···

On 30 Giu, 10:28, werner <wbru...@free.fr> wrote:

Can't help on the actual problem, but I wonder if wx.lib.floatcanvas or
floatcanvas 2 (http://trac.paulmcnett.com/floatcanvas,http://wiki.wxpython.org/GSoC2008/FloatCanvasRefactor) or wx.lib.ogl
wouldn't be a better start for something like a drawing window/app?

Joril wrote:

Well I think I *could* use FloatCanvas.. I haven't used it before
though, does it allow for scrollbars or is it supposed to work with
the zooming/panning toolbar, without scrollbars?

FloatCanvas itself could work fine with scrollbars, though no one has written that code yet -- it does come with the zooming/panning system, though.

That's because I like panning much better -- scroll bar annoy me for this sort of thing -- mainly for stuff that can be any unknown size.

But as an example, I like InkScape a lot -- but find the scrollbar navigation really annoying -- I really wish hit had a pan mode.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

FloatCanvas itself could work fine with scrollbars, though no one has
written that code yet -- it does come with the zooming/panning system,
though.

On second thought, maybe we could do without scrollbars too.. I'll do
some "hallway testing" to find out :slight_smile:

That's because I like panning much better -- scroll bar annoy me for
this sort of thing -- mainly for stuff that can be any unknown size.

Speaking of unknown size, is there a way to limit the "infinite
canvas" concept? Maybe intercepting the "panning" events?

Thanks for your attention!

···

On 30 Giu, 19:17, Christopher Barker <Chris.Bar...@noaa.gov> wrote: