Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
on.resize
47 bytes added
,
23:11, 3 September 2011
no edit summary
Line 7:
Line 7:
== Example ==
== Example ==
−
Below is an example of a program that
draws a line on
the
screen when
the user resizes the
window
:
+
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">
<source lang="lua">
function on.resize() --Define a function for the event
function on.resize() --Define a function for the event
−
theWidth = platform.window
.
width()
+
theWidth = platform.window
:
width()
−
theHeight = platform.window
.
height()
+
theHeight = platform.window
:
height()
end
end
</source>
</source>
−
You can then refer to the height and the width of the widget by calling the global variables instead of the [[
Catrgory
:platform.window]] methods.
+
You can then refer to the height and the width of the widget by calling the global variables instead of the [[
Category
:platform.window]] methods.
[[Category:Events]]
[[Category:Events]]
Adriweb
Bureaucrats
,
Administrators
935
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version