Drawing with wxClientDC

Alejandro ahmostovoi at gmail.com
Thu May 15 08:37:27 PDT 2008


Hi,
    thanks for your answer, but I need to do the Refresh because I need 
only one line at time in the screen.
I fix it doing the Refresh only when the coordinate of the line(the new 
line) is different from the old line.

Regards.
Alejandro

-------- Mensaje original --------
Asunto: Re: Drawing with wxClientDC
De: Robin Dunn <robin at alldunn.com>
Para: wx-users at lists.wxwidgets.org
Fecha: 15/05/2008 12:26 p.m.
> 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.
>



More information about the wx-users mailing list