drawTextWidth(text: String): Real;
The drawTextWidth method of the Window class returns the width of the graphical text output that would result from drawing the passed text string with the drawTextAt method. The text parameter is the text string.
The returned value is a
The method in the following example shows the use of the drawTextWidth method.
centerText(graphWin: Window; text: String; pos: Integer; vertical: Boolean): Integer; begin if vertical then return(pos + (graphWin.drawTextHeight(text).Integer/2)).Integer; else return(pos - (graphWin.drawTextWidth(text).Integer/2)).Integer; endif; end;