Changes

Jump to navigation Jump to search

platform.gc

8 bytes added, 00:06, 25 May 2011
no edit summary
Line 7: Line 7:  
A graphics context is available only during paint events, and that may be too late to create and size the containers for text fields.
 
A graphics context is available only during paint events, and that may be too late to create and size the containers for text fields.
 
This graphics context cannot be used to draw graphics since it is not tied to a window. It can however do that if this gc is used in a function called within [[on.paint]].
 
This graphics context cannot be used to draw graphics since it is not tied to a window. It can however do that if this gc is used in a function called within [[on.paint]].
 +
<br />
 +
 
Here is an example of using the dummy graphics context to get the pixel length and height of a string.
 
Here is an example of using the dummy graphics context to get the pixel length and height of a string.
 
<syntaxhighlight>local gc = platform.gc()                    -- Get the dummy graphics context
 
<syntaxhighlight>local gc = platform.gc()                    -- Get the dummy graphics context

Navigation menu