Page 1 of 1

Double Click to See Code

Posted: Mon Jun 18, 2012 6:52 pm
by townsend
Double clicking on an object currently opens up the object inspector.

How about the option to double click on an object to open up the code for that object.

Maybe on the Tools Pallet, the Run and Edit buttons could be combined,
and then have another on/off button for Inspector/Code on a double click.

Re: Double Click to See Code

Posted: Mon Jun 18, 2012 6:57 pm
by dunbarx
Hi.

You know that cmd-opt-click opens the script editor, right?

Craig Newman

Re: Double Click to See Code

Posted: Mon Jun 18, 2012 7:34 pm
by townsend
I didn't know that. Thanks. I'll use that.

I have the Inspector open all the time,
so that double click to open seemed useless.

Re: Double Click to See Code

Posted: Mon Jun 18, 2012 9:15 pm
by townsend
Actually-- that "opt" is important.
I checked the User Guide under shortcuts and found that Ctl-E does it.
890 shortcut.JPG
890 shortcut.JPG (8.64 KiB) Viewed 3343 times
Better than nothing-- but the double click option is still on my wish list.

Re: Double Click to See Code

Posted: Mon Jun 18, 2012 9:49 pm
by sturgis
ctrl-alt-click works. Not sure if thats easier than ctrl-e or not. :)

If you want to override the double click entirely you can use a simple plugin to do so. (very very simple, not sure if there are other things to worry about when doing it this way)


make a stack with 1 button. for its card script put the following

Code: Select all

on opencard 
insert the script of button 1 into front
end opencard

on closecard
remove the script of button 1 from front
end closecard
For the script of the button the following should work.

Code: Select all

on mousedoubleup pBtn
if pBtn is 1 and the selectedobject is not empty then
   edit the script of the selobj
else
   pass mousedoubleup
end if
end mousedoubleup
At this point you can save it to your plugins folder, restart lc, then adjust the setting of the plugin so that it opens on lc startup invisible. Or you could modify it so that it opens as a palette so that you can toggle the functionality on and off. Also, if you want the property inspector to always open for the object you're working on you can put "pass mousedoubleup" at the end of the handler outside the if block.

Re: Double Click to See Code

Posted: Mon Jun 18, 2012 11:20 pm
by townsend
Oh yeah-- The Ctl-Alt Click works. I'll use that.

As for overriding the IDE default, it good to know that's possible.
And thanks for that code.