Mobile text input mystery
Graham Samuel
livfoss at mac.com
Wed Apr 22 12:00:39 EDT 2020
As usual, the problem will be my fault, but I can’t get a mobile input field to appear on a card. I’m debugging it at present, which explains the answer statement:
on opencard -- we dynamically create a field for the user to key in
global sinputID -- this is all from the LC lesson. It’s a global because I need to refer to it in a button later
if environment() = "mobile" then
mobileControlCreate "input", "FMyText" -- so the user can type in
put the result into sinputID — the Dictionary doesn’t mention ‘the result’ but it does seem to be right
answer "opening text field for input. ID created is:" && sinputID
mobileControlSet sinputID, "rect", “114,135,163,158” — this is a real location on the card
mobileControlSet sinputID, "visible", "true"
mobileControlSet sinputID, "opaque", "true"
end if
end opencard
As far as I’m concerned this comes straight out of the LC dictionary. When I run this in the iPhone simulator, it the ‘answer’ fires, and the ID is 1. But nothing appears on the card.
Can anyone explain what I’m doing wrong this time? I seem to have a lot of trouble getting dynamic elements like fields, keyboards and selection scrollers to appear, but the above is the simplest problem I have in that line.
Graham
More information about the use-livecode
mailing list