Hi List,

First special thanks to RBNUBE and CV for helping me out

These are my findings with the drawstring problem

This code on OSX does not work on my macbook pro with RB2006/4

Sub Action()

  Dim aCanvas as Canvas

  aCanvas = new Canvas1
  '
  aCanvas.Top = 7
  aCanvas.Left = 314
  aCanvas.Graphics.TextFont="Arial"
  aCanvas.Graphics.TextSize=14
  aCanvas.Graphics.ForeColor=RGB(255,0,0)
aCanvas.Graphics.DrawString("Joe Bob Gizzerdamp YEAH!!!", 10,10,aCanvas.Width-10)

End Sub

More precisely everything works but the last line
The code as stated above works on windows ( cfr RBNube)

Jack(CV) helped me by posting that the 3 last lines should be placed within a select case construct in the paint event of the canvas
That works

However RBNube warns that this will lead to flickering on Windows systems

So here I am needing something cross-platform AND maintainable (by this I mean that I can see how I could place differing code for OSX and Windows, but that can hardly be the way to go for a crossplatform tool and what seems to me being a fairly common task)

RBNube told me that when placing a messagebox before drawing into the canvas cured the problem on mac which lead me to this code that works

Sub Action()

  Dim aCanvas as Canvas

  aCanvas = new Canvas1
  '
  aCanvas.Top = 7
  aCanvas.Left = 314
  aCanvas.Graphics.TextFont="Arial"
  aCanvas.Graphics.TextSize=14
  aCanvas.Graphics.ForeColor=RGB(255,0,0)

  self.Refresh(True)

aCanvas.Graphics.DrawString("Joe Bob Gizzerdamp YEAH!!!", 10,10,aCanvas.Width-10)

End Sub

Can somebody shed some light on the way to go ? And as to WHY the first example does not work?

TIA

Bart Pietercil





_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to