Difference between revisions of "D2Editor:resize"
Jump to navigation
Jump to search
Jimbauwens (talk | contribs) (Created page with "D2Editor.'''resize''' is a function that is part of the D2Editor Library. <br> This function resizes a D2Editor to the gives height and width. == Syntax == D2Editor...") |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | D2Editor | + | D2Editor:'''resize''' is a function that is part of the D2Editor Library. |
<br> | <br> | ||
− | This function resizes a D2Editor to the gives height and width. | + | This function resizes a D2Editor to the gives height and width. |
== Syntax == | == Syntax == | ||
− | D2Editor:'''resize'''(width, height) | + | D2Editor:'''resize'''(width, height) |
== Example == | == Example == | ||
− | <source lang="lua"> | + | <source lang="lua" highlight=4> |
− | function on. | + | function on.construction() -- or on.create if OS 3.1 |
editor = D2Editor.newRichText() | editor = D2Editor.newRichText() | ||
editor:move(0,0) | editor:move(0,0) | ||
Line 30: | Line 30: | ||
</source> | </source> | ||
− | A very simple text editor (its actually more complicated that it be, but it shows the basics). | + | A very simple text editor (its actually more complicated that it should be, but it shows the basics). |
+ | |||
== See also == | == See also == | ||
− | + | <categorytree mode=pages>D2Editor</categorytree> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:D2Editor]] | [[Category:D2Editor]] |
Latest revision as of 17:49, 18 June 2012
D2Editor:resize is a function that is part of the D2Editor Library.
This function resizes a D2Editor to the gives height and width.
Syntax
D2Editor:resize(width, height)
Example
function on.construction() -- or on.create if OS 3.1
editor = D2Editor.newRichText()
editor:move(0,0)
editor:resize(200,100)
end
function on.charIn(char)
currentText = editor:getText()
editor:setText(currentText .. char)
--Add char to the editor
end
function on.enterKey()
on.charIn(string.char(10))
--Add a new line
end
A very simple text editor (its actually more complicated that it should be, but it shows the basics).
See also
<categorytree mode=pages>D2Editor</categorytree>