Difference between revisions of "platform.window:width"

From Inspired-Lua Wiki
Jump to navigation Jump to search
m (moved platform.window.width to platform.window:width: Text replace - "platform.window.width" to "platform.window:width")
Line 8: Line 8:
  
 
== Example  ==
 
== Example  ==
<syntaxhighlight>ww = platform.window:width()</syntaxhighlight>
+
Below is an example of a program that creates/updates the "theHeight"  ad "theWidth" global variables whenever the user resizes the widget's  frame:
 +
<source lang="lua">
 +
function on.resize() --Define a function for the event
 +
    theWidth = platform.window:width()
 +
    theHeight = platform.window:height()
 +
end
 +
</source>
  
<br /><br />
+
<br />
  
 
[[Category:platform.window]]
 
[[Category:platform.window]]

Revision as of 22:12, 3 September 2011

platform.window:width is a function that is part of platform.window.

This has been introduced in TI-Nspire OS 3.0 (Changes).

Returns the width in pixel of the current display window.

Syntax

platform.window:width()
(No arguments)

Example

Below is an example of a program that creates/updates the "theHeight" ad "theWidth" global variables whenever the user resizes the widget's frame:

function on.resize() --Define a function for the event
    theWidth = platform.window:width()
    theHeight = platform.window:height()
end