Event Driven Programming

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
sandybassett
Posts: 35
Joined: Fri May 31, 2013 7:44 pm

Event Driven Programming

Post by sandybassett » Wed Jun 26, 2013 4:18 am

I have several actions to code which could be triggered by different events. Is there a list of all events which can be used to trigger a handler or a function so that I can choose which would be most appropriate to use in the situation? I've looked everywhere but haven't been able to find one so I can get the name or syntax correct without a lot of trial and error. Thanks for the help.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Event Driven Programming

Post by FourthWorld » Wed Jun 26, 2013 9:20 am

The Dictionary lets you filter by messages.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Event Driven Programming

Post by Mark » Wed Jun 26, 2013 12:19 pm

Hi,

I'd search the dictionary for "mouse", "field" and "key". This will reveal a list of frequently used messages that will be convenient to use. Additionally, I have a few sections dedicated to this subject in my book.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Event Driven Programming

Post by jacque » Wed Jun 26, 2013 6:21 pm

In the dictionary you can click on any column to sort by that column. If you do that, all the "Message" entries will be together. Those are the events your app will be notifed about.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Event Driven Programming

Post by Mark » Wed Jun 26, 2013 6:32 pm

Hi,

You don't need to sort. You can also click on the messages section in the side bar and you will only see messages.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

sandybassett
Posts: 35
Joined: Fri May 31, 2013 7:44 pm

Re: Event Driven Programming

Post by sandybassett » Wed Jun 26, 2013 6:51 pm

Thanks guys, that's exactly what I was looking for. Mentally indexed it under handlers, or functions, or triggers, never thought to look at messages.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Event Driven Programming

Post by mwieder » Wed Jun 26, 2013 7:53 pm

Yeah, I always have to make the jump from "events" to "messages". And then I refer to them interchangeably, which no doubt confuses people.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Event Driven Programming

Post by dunbarx » Wed Jun 26, 2013 7:55 pm

All good stuff.

But there will always be a bit of intuition required, even among those who have read and reread the entire dictionary while on the potty.

A new user, asked what events seem logical when, say, clicking the mouse in a button, might well foresee "mouseDown" and "mouseUp". A precocious twelve year old might also see "mouseEnter". But you would be gifted as a newbie indeed to posit "mouseStillDown" or "mouseWithin" without experience.

So be creative with your searches, and think out of the box sometimes. You might also take a stab at monitoring the message watcher. Good luck with that.

Craig Newman

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Event Driven Programming

Post by Mark » Wed Jun 26, 2013 8:21 pm

Hi Craig,

I agree. I wish that keywords like "mouse", "field" and "text box" would be sufficient to get all the messages and properties related to text fields for instance. We really need full-text search built into the dictionary.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

sandybassett
Posts: 35
Joined: Fri May 31, 2013 7:44 pm

Re: Event Driven Programming

Post by sandybassett » Wed Jun 26, 2013 8:26 pm

Mark said: "We really need full-text search built into the dictionary."
That's a GREAT idea! Tell Kevin.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Event Driven Programming

Post by dunbarx » Wed Jun 26, 2013 9:08 pm

Full text search is a good idea all right. Is there a text file somewhere that contains the entire dictionary? Would not take much to roll your own if there was. You could even build in the links to the "See also..." entries, which I always find very useful. I am going to make a feature request.

Craig

Post Reply