what do you do when you are bored?

Are you developing tools to extend the LiveCode environment? This is the place to talk about the nuts and bolts of extending our nuts and bolts. If you want to use a LiveCode or third party Environment extension, visit the Using Evironment Extensions forum.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
shaosean
Posts: 907
Joined: Thu Nov 04, 2010 7:53 am

what do you do when you are bored?

Post by shaosean » Sat Aug 18, 2012 5:17 pm

i was bored the other night at work and thought to myself "how come custom controls can't be called like first class controls?".. this is what i came up with < http://shaosean.tk/runrev/rnd/screencap ... andler.mp4 >

the two buttons are calling the "pig" command in the button "targetControl".. standard rev way is using send (I guess I could have used dispatch, but the idea is the same).. my way, well, you can see the code [if you can't, the code is posted here as well]

targetControl

Code: Select all

on pig
  answer "squeal"
end pig
standard rev way

Code: Select all

send "pig" to control "targetControl"
shaosean's way

Code: Select all

targetControl "pig"
you can pass an arbitrary amount of parameters as well.. will work on doing functions next week.. i was working on a dot notation version, but rev crashed.. i wonder if the engine objected ;-)

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: what do you do when you are bored?

Post by Dixie » Sat Aug 18, 2012 8:35 pm

:D Interesting !... perhaps boredom at work should set in more often..

be well

Dixie

shaosean
Posts: 907
Joined: Thu Nov 04, 2010 7:53 am

Re: what do you do when you are bored?

Post by shaosean » Sun Aug 19, 2012 3:48 pm

Oh god it happens more than you could imagine ;-)

shaosean
Posts: 907
Joined: Thu Nov 04, 2010 7:53 am

Re: what do you do when you are bored?

Post by shaosean » Fri Mar 29, 2013 6:19 am

Finally got back to this and managed to get dot notation working ;-)

Post Reply

Return to “Extending LiveCode”