Difference between newTextBox and newTextField?

I've been trying to figure out how to create a multiline text box for inputting text by the user.

If I use newTextField and set width and height, I can make a nice big field to input text, but carriage returns don't work and I get borders around my text (which I don't want).

If I use newTextBox (which the docs say is for display only) and set it's isEnterable property to true in order to make it so, I can add multiple lines with carriage returns just fine, but wonder if I'm not supposed to use it for entering text.

In either case, I also can't seem to get the began event phase to fire. It seems that only the ended and submitted phases are working.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
        local onFieldEvent = function ( event )
        print (event.phase)
                if ( "began" == event.phase ) then
                        -- This is the "keyboard has appeared" event
                        -- In some cases you may want to adjust the interface when the keyboard appears.
                        --tattleBox = ""
 
                elseif ( "ended" == event.phase ) then
                        -- This event is called when the user stops editing a field: for example, when they touch a different field
 
                elseif ( "submitted" == event.phase ) then
                        -- This event occurs when the user presses the "return" key (if available) on the onscreen keyboard
 
                        -- Hide keyboard
                        native.setKeyboardFocus( nil )
                end
        end
views:1339 update:2012/1/3 13:02:13
corona forums © 2003-2011