Asking to open unit1.lrs while trace into Component method. lazarus / 15-macOS - Mac OS X ---------------------------------------------------------------------- dan59314 · 2010-01-27 03:36 Hi,   I write a simple component, let said TMyPaintBox, just inherite from TPaintBox and add a new public procedure 'Render'.   Inside TMyPaintBox.Render(), I call the Self.Refresh. I can installed this component , see it on the VCL tabs and drag it into my TForm without problem. Code: [Select]procedure TMyPaintBox.Render; begin   ....   ...  do something here     Self.Refresh; // hanged here end;    I then inside TForm, within a buttonClick() to call myPainBox.Render, While I try to trace step into TMyPaintBox.Render(), it did step into TMyPaintBox.Render(), but while calling Self.Refresh, Lazarus prompt with a dialog, saying can't find unit1.lrs, asking me to open it by myself.   I then browse and open the unit1.lrs, IDE shows a mass of yellow strings(the unit1.lrs file itself). Then it hanged in the last line of those yellow string, can't go further anymore.   Why I have to trace into Render is I suppose Self.Refresh should trigger the TMyPaintBox.OnPaint(). But my codes inside TForm.MyPaintBoxPaint(), it never be triggered.   Can anyone tell me why the TMyPaintBoxPaint() can't be triggered and why tracing into Self.Refresh was hanged? Thanks, Daniel ---------------------------------------------------------------------- Zaher · 2010-01-27 10:49 First Use "Invalidate" instead of "Refresh" directly. When you make invalidate or refresh it must trigger OnPaint() method. sometime i have problem with MultiThread debuging, try not debug just add log message to file. ---------------------------------------------------------------------- dan59314 · 2010-01-29 00:48 Quote from: Zaher on January 27, 2010, 11:49:08 amFirst Use "Invalidate" instead of "Refresh" directly. When you make invalidate or refresh it must trigger OnPaint() method. sometime i have problem with MultiThread debuging, try not debug just add log message to file. Hi, Zaher,    Thanks.    Invalidate() did trigger OnPaint() method, but not the Paint() function?    I have some routine work have to do, so I put it inside Paint().    Is there any way that I can solve this problem? Thanks, Daniel ---------------------------------------------------------------------- skalogryz · 2010-01-29 09:05 did you forget to override the Paint method? ---------------------------------------------------------------------- dan59314 · 2010-02-02 08:43 Quote from: skalogryz on January 29, 2010, 10:05:05 amdid you forget to override the Paint method? No, I didn't forget it. And it works in Windows and Linux, but the Mac. Daniel