Drawing with wxClientDC

Robin Dunn robin at alldunn.com
Thu May 15 08:26:02 PDT 2008


Alejandro wrote:
> Hi,
>    I tried with your solution, but it doesn't work. I'm using a 
> wxSimpleHtmlListBox and not a wxFrame like I said, I' don't know if this 
> could make any difference.
> Now my code is:
>       wxClientDC *pclientdc = new wxClientDC(plist);
>       pclientdc->DrawLine(0, coord_y, plist->GetSize().GetX(), coord_y);
>       delete pclientdc;
>       plist->Refresh();
> 
> where plist is a pointer to a wxSimpleHtmlListBox.
> I tried, setting to the wxSimpleHtmlListBox.the background style, I 
> mean, plist->SetBackgroundStyle(wxBG_STYLE_CUSTOM) and still doesn't work.
> 

Don't do the Refresh.  That causes a paint event to be sent which will 
draw over what you've just drawn with the default content of the widget.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



More information about the wx-users mailing list