Graphics not working on Mac/PowerPC lazarus / 39-Graphics ---------------------------------------------------------------------- WalterK · 2011-04-15 15:03 I'm using version 0.9.30 on my PowerPC Mac running OS 10.5.8... I''m trying to draw some lines in a TPanel (GraphPanel).  The below code (boiled down) has no visible output on my Mac, but does draw a line on my Windows laptop (Vista).    maxY := GraphPanel.Height;    maxX := GraphPanel.Width; GraphPanel.Canvas.Pen.Color:=clBlack; GraphPanel.Canvas.Pen.Width:=4;    GraphPanel.Canvas.Line(0,0,maxx,maxy);    GraphPanel.Invalidate; Can someone tell me what I'm doing wrong? TIA. ---------------------------------------------------------------------- eny · 2011-04-15 15:10 Maybe it's because a TPanel isn't supposed to be used as a drawing surface. For example it doesn't have an (accessible) OnPaint method. Maybe it works if you manually set the OnPaint method of TPanel and do all painting in there. ---------------------------------------------------------------------- Arbee · 2011-04-15 15:19 I do know there is indeed a difference in how (or when) Windows and Mac update the screen.  I haven't been able to exactly pinpoint what that difference is. Your code does not say where it is actually invoked (in some onxxxxxx event I gather), so it is hard to tell what heppens. Incidentally ... a TPaintbox won't work either? ---------------------------------------------------------------------- Arbee · 2011-04-15 15:49 Or ... a TImage. ---------------------------------------------------------------------- WalterK · 2011-04-15 19:43 OK.  It's working now... I used a TPanel because it has a Canvas and I didn't know any better.  I was drawing the lines upon a button click.  Apparently this is major-ignorant. I changed to use a TPaintBox and put the line drawing code inside an OnPaint routine and it works. (I'll suspect this will work under Windows also.) Thanks. ---------------------------------------------------------------------- circular · 2011-04-15 20:45 If you call Invalidate after you draw, it erases everything.