Putting some life into an empty field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Putting some life into an empty field

Post by RossG » Thu May 24, 2018 6:14 am

I have three fields which I've set up to
react to a mouseUp but I find that if
a field is empty it "plays dead" even
though I've added code to get a function
if "me is empty" but still no reaction.

Is there an answer?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Putting some life into an empty field

Post by SparkOut » Thu May 24, 2018 6:42 am

Unlocked fields don't react to mouse events the same way as locked fields, since it will likely need user interactions such as using the mouse to place the cursor, for instance. Try setting the lockText to true and see if it behaves as you expect.
You can use other events such as openField and selectionChanged to have scripts in your unlocked fields that do things.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Putting some life into an empty field

Post by dunbarx » Thu May 24, 2018 1:55 pm

What Sparkout said.

So, are your fields indeed unlocked? If so, then also read in the dictionary about the "textChanged" message.

The point he made was that you will have to use one or more of these in order to detect an "action" in an editable field. After all, "mouseUp" is only that, a message sent when you do something in a control. "Do", here, means to create an event that sends a message.

Craig Newman

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”