Ways to get the IDs of two already scripted buttons?

Mike Bonner bonnmike at gmail.com
Mon Jan 2 18:49:02 EST 2012


I put this into the card. It doesn't account for LOTS of things (such as
multiple copies of the line if you just keep alt-clicking buttons) but does
demonstrate a way to draw lines between 2 consecutively chosen buttons. If
there are scripts in the button, they must pass mouseUp to work. If they're
empty then its a non-issue.  This script goes in the card script. Don't
know if it'll help or if its too simplistic but perhaps it's a start.

local sLastClick
on mouseUp
   if the altkey is down then
      if the name of the target contains "button" then
         if sLastClick is empty then
            put the id of the target into sLastClick
            answer information "first button chosesn"
         else
            create grc "connectLine"
            set the style of grc "connectLine" to "line"
            set the points of grc "connectLine" to (the loc of the target)
& return & (the loc of button id sLastClick)
            put the id of the target into sLastClick
         end if
      end if
   end if
end mouseUp
On Mon, Jan 2, 2012 at 3:45 PM, Kresten Bjerg <Kresten.Bjerg at psy.ku.dk>wrote:

> Thanks for replies
> John: if a mouseenter can do the job, I guess that would be OK, -does this
> suggestion imply, that Altclick cannot be used ?
> Craig: Unfortunately modifying button scripts is out of the question
> I am afraid, that I need a step by step, line by line, guidance in this
> I paste my latest naïve attempt as a starting point -which evidently
> doesn't achieve anything !!!!
> on lineconnect
> Answer "select the first textbutton of a pair by holding alt- button down
> and click it."  with  "Yes" or "Escape" titled "Step one in establishing a
> line connecting two buttons"
> wait 10 seconds
> wait until object is selected
> put the ID of  the selectedobject into firstbuttonID
> (continued in next posting)
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list