Using MSW, a paint event is generated whenever a portion of the window is damaged. In the case of moving a dialog across a window, this sends dozens of events to redraw.
Using GTK on Linux, a paint event is only sent once the dialog is relased resulting in only a small number of redraw events usually 2 or 3.
This leads to jinter in the case of a canvas containing many wxpanels (20) on windows.
Any ideas how I can ignore the paint events until the last couple and then redraw?
Using MSW, a paint event is generated whenever a portion of the window is damaged. In the case of moving a dialog across a window, this sends dozens of events to redraw.
Using GTK on Linux, a paint event is only sent once the dialog is relased resulting in only a small number of redraw events usually 2 or 3.
This leads to jinter in the case of a canvas containing many wxpanels (20) on windows.
Any ideas how I can ignore the paint events until the last couple and then redraw?
The only thing I can think of is to just set a flag in the EVT_PAINT handler, and then do the real paint in an EVT_IDLE handler. Don't forget to create a wxPaintDC in your EVT_PAINT handler eventhough you are not using it, otherwise you'll have troubles on wxMSW.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Thanks Robin. I hadn't thought of that. So the first thing I tried was to
call the OnPaint from OnIdle and got an assertion error (only allowed to
create a wxPaintDC in OnPaint). Next I tried to have a wxClientDC do the
same things in the OnIdle as the OnPaint/wxPaintDC but it brushed over the
children (wxPanels sitting on a wxScrollWindow) while the wxPaintDC doesn't.
Nigel
···
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Monday, November 18, 2002 2:27 PM
Subject: Re: [wxPython-users] wxPaintEvent frequency
Nigel Moriarty wrote:
> Using MSW, a paint event is generated whenever a portion of the window
> is damaged. In the case of moving a dialog across a window, this sends
> dozens of events to redraw.
>
> Using GTK on Linux, a paint event is only sent once the dialog is
> relased resulting in only a small number of redraw events usually 2 or
3.
>
> This leads to jinter in the case of a canvas containing many wxpanels
> (20) on windows.
>
> Any ideas how I can ignore the paint events until the last couple and
> then redraw?
>
The only thing I can think of is to just set a flag in the EVT_PAINT
handler, and then do the real paint in an EVT_IDLE handler. Don't
forget to create a wxPaintDC in your EVT_PAINT handler eventhough you
are not using it, otherwise you'll have troubles on wxMSW.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Thanks Robin. I hadn't thought of that. So the first thing I tried was to
call the OnPaint from OnIdle and got an assertion error (only allowed to
create a wxPaintDC in OnPaint). Next I tried to have a wxClientDC do the
same things in the OnIdle as the OnPaint/wxPaintDC but it brushed over the
children (wxPanels sitting on a wxScrollWindow) while the wxPaintDC doesn't.
Do you use the wxCLIP_CHILDREN style?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have attached a simple script that demonstrates this. It put two wxPanels
on a window and draws a line between them. OnPaint increments a counter and
OnIdle calls OnClient to draw the lines. On GTK (LINUX) one can see the
panels and the line. On MSW one can only see the line.
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Wednesday, December 04, 2002 4:37 PM
Subject: Re: [wxPython-users] wxPaintEvent frequency
Nigel Moriarty wrote:
> Thanks Robin. I hadn't thought of that. So the first thing I tried was
to
> call the OnPaint from OnIdle and got an assertion error (only allowed to
> create a wxPaintDC in OnPaint). Next I tried to have a wxClientDC do
the
> same things in the OnIdle as the OnPaint/wxPaintDC but it brushed over
the
> children (wxPanels sitting on a wxScrollWindow) while the wxPaintDC
doesn't.
Do you use the wxCLIP_CHILDREN style?
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
It seems that is the dc.Clear() in the DrawConns that is causing the
problem. It behaves differently on GTK and MSW and ignores the
wxCLIP_CHILDREN on the latter.
Nigel
···
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Wednesday, December 04, 2002 4:37 PM
Subject: Re: [wxPython-users] wxPaintEvent frequency
Nigel Moriarty wrote:
> Thanks Robin. I hadn't thought of that. So the first thing I tried was
to
> call the OnPaint from OnIdle and got an assertion error (only allowed to
> create a wxPaintDC in OnPaint). Next I tried to have a wxClientDC do
the
> same things in the OnIdle as the OnPaint/wxPaintDC but it brushed over
the
> children (wxPanels sitting on a wxScrollWindow) while the wxPaintDC
doesn't.
Do you use the wxCLIP_CHILDREN style?
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
I have attached a simple script that demonstrates this. It put two wxPanels
on a window and draws a line between them. OnPaint increments a counter and
OnIdle calls OnClient to draw the lines. On GTK (LINUX) one can see the
panels and the line. On MSW one can only see the line.
I see both the panels and the line, except the line is not visible while resizing the frame. Is this what you mean? If so it's to be expected since you are defering the draw until idle time. The difference is that by default Windows will send erase and paint messages while resizing and on Linux it is up to the window manager policies how it is handled.
I don't remember what the original message was about but if you are concerned about flickering they you might want to use the wxNO_FULL_REPAINT_ON_RESIZE on the frame and canvas window and then use the UpdateRegion to only draw what needs refreshed.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
It seems that is the dc.Clear() in the DrawConns that is causing the
problem. It behaves differently on GTK and MSW and ignores the
wxCLIP_CHILDREN on the latter.
Which version of wxPython?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, December 06, 2002 9:43 AM
Subject: Re: [wxPython-users] wxPaintEvent frequency
Nigel Moriarty wrote:
> Robin
>
> It seems that is the dc.Clear() in the DrawConns that is causing the
> problem. It behaves differently on GTK and MSW and ignores the
> wxCLIP_CHILDREN on the latter.
>
Which version of wxPython?
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
----- Original Message -----
From: "Nigel Moriarty" <a_list@attbi.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, December 06, 2002 10:28 AM
Subject: Re: [wxPython-users] wxPaintEvent frequency
2.3.2.1 hybrid
----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, December 06, 2002 9:43 AM
Subject: Re: [wxPython-users] wxPaintEvent frequency
> Nigel Moriarty wrote:
> > Robin
> >
> > It seems that is the dc.Clear() in the DrawConns that is causing the
> > problem. It behaves differently on GTK and MSW and ignores the
> > wxCLIP_CHILDREN on the latter.
> >
>
> Which version of wxPython?
>
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org