I hope one or other of the experts here can give me
some advice...
In my wxPython (oh how I love it) app under Win32, I
am wanting to use
little wxOGL wxShapes as slider bars, for defining
start and stop
positions. The idea is very simple - the user clicks
on the bar,
drags it to the required position, and releases it.
The trick is that
the bar must have a fixed Y position. That is, when
the user drags
the bar, it only moves horizontally.
Now I've managed to get it working after a fashion,
but it's VERY
inefficient. My event handler includes the following:
def OnMovePre(self,dc,x,y,oldX,oldY,display):
if y == oldY:
return true
return false
Doing this causes horrid flicker, and steals lots of
CPU cycles.
Can anyone think of a more elegant way of doing this
using wxOGL? I
could probably use GDI primitives, but I don't fancy
all the schlep of
doing hit testing etc.
Thanks & regards,
Ben
···
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/
> Doing this causes horrid flicker, and steals lots
of
> CPU cycles.
Why not just shape.Move(X, 18) ?
For some reason, this leaves little "droppings" while
the bar is being scrolled. That is, the canvas
doesn't seem to get repainted during the dragging.
Cheers,
Ben
···
--- Robin Dunn <robin@alldunn.com> wrote:
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
> > Doing this causes horrid flicker, and steals lots
> of
> > CPU cycles.
>
> Why not just shape.Move(X, 18) ?
For some reason, this leaves little "droppings" while
the bar is being scrolled. That is, the canvas
doesn't seem to get repainted during the dragging.
This may be another manifestation of a Refresh bug in 2.3.2. If you can try
it with 2.3.3 and see if there is any difference.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!