UITextField & UITextView examples?
m.schonewille at economy-x-talk.com
Tue Aug 23 07:23:07 EDT 2011
Here's an example. It is a silly one, but it works.
Make a graphic with the following script:
iPhoneControlSet "test","rect",the rect of grc 1
put iPhoneControlGet("test","text") into x
It will set and get the text from the UITextView. If you want to have a UITextView permanently available for editing, you need to create it when the stack opens:
iPhoneControlSet "Sample","rect",the rect of grc 1
The line that makes the UITextView visible is essential, because it is invisible by default (an incomprehesible choice IMHO). Set the script of the graphic to:
iphoneControlDo "Sample", "focus"
Whenever you need the text, you can access the text property using the iPhoneControlGet function.
It is quite a shame that UITextFields aren't built into LiveCode as native objects. I wish we wouldn't need to think about whether we're using Android, iPhone or Windows. Alas, these objects are simulated rather than native, making it quite a hassle to use them. Consequently, there is no simple-ish solution and reading this lesson http://qery.us/xu is necessary to understand how UITextViews work.
Economy-x-Talk Consulting and Software Engineering
What does that error mean? Buy LiveCodeErrors for iPhone now http://qery.us/v4 A must-have for LiveCode programmers.
On 23 aug 2011, at 09:50, Phil Jimmieson wrote:
> Hi folks,
> Does anyone have any simple-ish examples of using UITextFields and UITextViews in LiveCode iOS apps that they're willing to share? I'm a bit lost without some actual examples to pick apart.
> Phil Jimmieson phil at liverpool.ac.uk (UK) 0151 795 4236
> Computer Science Dept., Liverpool University, Ashton Building, Ashton Street
> Liverpool L69 3BX http://www.csc.liv.ac.uk/~phil/
> I used to sit on a special medical board... ...but now I use this ointment.
More information about the Use-livecode