New Video : Lets hack the LiveCode IDE with a plugin
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
New Video : Lets hack the LiveCode IDE with a plugin
Time for another vid?
A simple tutorial showing how to create a plugin to add a button to the LiveCode MenuBar.
https://www.youtube.com/watch?v=LpvtZNPiuIg&t=36s
A simple tutorial showing how to create a plugin to add a button to the LiveCode MenuBar.
https://www.youtube.com/watch?v=LpvtZNPiuIg&t=36s
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
Re: New Video : Lets hack the LiveCode IDE with a plugin
Thanks Andy, just one question though:
what doesdo, apart from set a new custom property called destroyMode? There isn't a built-in property called destroyMode that I am aware of.
(For that matter, I can't get my IDE editing plugins to purge from memory either, no matter the settings of the destroyWindow and destroyStack properties.)
what does
Code: Select all
set the destroyMode of stack "theStackName"
(For that matter, I can't get my IDE editing plugins to purge from memory either, no matter the settings of the destroyWindow and destroyStack properties.)
Re: New Video : Lets hack the LiveCode IDE with a plugin
I thought that was when 'destroyStack' and 'destroyWindow' just wasn't enough, then you go into 'destroyMode' where anything / one can be the target
The second sounds like a bug to me, but I haven't actually done any testing with it
Aside from that, like my comment on the vid page says, very well done Andy
The second sounds like a bug to me, but I haven't actually done any testing with it
Aside from that, like my comment on the vid page says, very well done Andy
Re: New Video : Lets hack the LiveCode IDE with a plugin
Well I had a feeling that closing the stack inside the openStack handler was like trying to levitate by standing in two buckets and pulling up on the handles. So to solve the issue of the plugin "launcher" stack not purging from memory, instead of putting the close stack command in as the last line of the openStack handler, I made that and put the close stack command into the closeMe handler in the stack script. That lets the openStack handler finish before trying to close itself.
And thanks again Andy, I have made various tweaks and hacks to the IDE in various ways before, but never bothered to make the effort to do this sort of plugin before. Which is of course, less effort than the hacky-tweak way.
(Now I've reappropriated the Dictionary icon and it fires up tinyDictionary instead, and responds much quicker and is more legible with less white space and fewer formatting anomalies.)
Code: Select all
send "closeMe" to stack "IDE hack stack" in 200 milliseconds
And thanks again Andy, I have made various tweaks and hacks to the IDE in various ways before, but never bothered to make the effort to do this sort of plugin before. Which is of course, less effort than the hacky-tweak way.
(Now I've reappropriated the Dictionary icon and it fires up tinyDictionary instead, and responds much quicker and is more legible with less white space and fewer formatting anomalies.)
Re: New Video : Lets hack the LiveCode IDE with a plugin
Tiny Dictionary is the bomb! And your right, Andy's method is far easier than the hacky tweaky method you and I share, I just have come to appreciate the hacky tweaky method itself
Re: New Video : Lets hack the LiveCode IDE with a plugin
Ah yes, of course it should be destroyStack and not destroyMode.
I've made a note in the video description.
Thanks for pointing this out.
Hopefully no mistakes next time!
I will be covering special folders in the next video, anything you think should be included, gotchas etc.
Obviously this YouTube channel is unlikely to have a high view count but its an interesting exercise for me, I am learning a lot as I go along, not only with LiveCode but video editing etc, also in this video I've been working on my vocals as I know my voice is pretty monotone, most of all just trying to keep the grey matter active and spread the word on how great LiveCode is for desktop apps across the 3 main platforms.
Again thanks for any comments or ideas for future videos.
I've made a note in the video description.
Thanks for pointing this out.
Hopefully no mistakes next time!
I will be covering special folders in the next video, anything you think should be included, gotchas etc.
Obviously this YouTube channel is unlikely to have a high view count but its an interesting exercise for me, I am learning a lot as I go along, not only with LiveCode but video editing etc, also in this video I've been working on my vocals as I know my voice is pretty monotone, most of all just trying to keep the grey matter active and spread the word on how great LiveCode is for desktop apps across the 3 main platforms.
Again thanks for any comments or ideas for future videos.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
Re: New Video : Lets hack the LiveCode IDE with a plugin
Biggest gotcha I can think of is to be aware that they are slightly different for all 3 desktops, and that if someone changes the name of say, any of those locations, Lc probably won't be pointing at the right one.
Re: New Video : Lets hack the LiveCode IDE with a plugin
specialFolderPath("resources") > specialFolderPath("engine")
specialFolderPath names resolve without trailing slashes so ensure to include a slash when concatenating with subfolder and file names.
specialFolderPath names resolve without trailing slashes so ensure to include a slash when concatenating with subfolder and file names.
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: New Video : Lets hack the LiveCode IDE with a plugin
Love this tutorial and used it .
But how can I add the Run and Edit buttons to the MenuBar as well as a toggle for the Tools menu on which those buttons reside?
Regards,
Paul
But how can I add the Run and Edit buttons to the MenuBar as well as a toggle for the Tools menu on which those buttons reside?
Regards,
Paul
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: New Video : Lets hack the LiveCode IDE with a plugin
After some more digging, I found the solutionmrcoollion wrote: ↑Mon Jun 15, 2020 9:23 amLove this tutorial and used it .
But how can I add the Run and Edit buttons to the MenuBar as well as a toggle for the Tools menu on which those buttons reside?
Regards,
Paul
Anyone interested let me know and I will post the stack here.
regards,
Paul
Re: New Video : Lets hack the LiveCode IDE with a plugin
Yes. Put your stack here.
Thanks,
Linda
Thanks,
Linda
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: New Video : Lets hack the LiveCode IDE with a plugin
Hi Linda,
Here are the stack(s). Yes I made two. 'Hack_LC_IDE_01.livecode' is for development and the MenuHack01_Run.livecode is for in the externals/plugin folder. The only difference is that in the run version at the preOpenStack part I make the stack invisible and the stack also closes itself after placing the buttons in the menubar.
Just copy the MenuHack01_Run.livecode into your User Extensions > plugins folder and after re-starting LC and starting the plugin the additional Buttons in your toolbar are: Save, Tools, Project Browser, Run mode and Edit Mode.
There is still a lot of room for improvement. E.g. place information in the tooltip of the buttons, better alignment, other icons... whatever you prefer.
have fun
Regards,
Paul
Here are the stack(s). Yes I made two. 'Hack_LC_IDE_01.livecode' is for development and the MenuHack01_Run.livecode is for in the externals/plugin folder. The only difference is that in the run version at the preOpenStack part I make the stack invisible and the stack also closes itself after placing the buttons in the menubar.
Just copy the MenuHack01_Run.livecode into your User Extensions > plugins folder and after re-starting LC and starting the plugin the additional Buttons in your toolbar are: Save, Tools, Project Browser, Run mode and Edit Mode.
There is still a lot of room for improvement. E.g. place information in the tooltip of the buttons, better alignment, other icons... whatever you prefer.
have fun
Regards,
Paul
Re: New Video : Lets hack the LiveCode IDE with a plugin
Thanks for the positive comments.
The easiest way is to use the send command with this format
send "menuPick" && "MENU-ITEM" to button "MENU-HEADING" of stack "revMenuBar"
So for run and edit;
send "menuPick" && "Browse Tool" to button "Tools" of stack "revMenuBar"
or
send "menuPick" && "Pointer Tool" to button "Tools" of stack "revMenuBar"
Other examples;
send "menuPick" && "Dictionary (API)" to button "Help" of stack "revMenuBar"
send "menuPick" && "Backdrop" to button "View" of stack "revMenuBar"
send "menuPick" && "Save" to button "File" of stack "revMenuBar"
Warning -- Once you get into hacking the IDE, its hard to stop!
The easiest way is to use the send command with this format
send "menuPick" && "MENU-ITEM" to button "MENU-HEADING" of stack "revMenuBar"
So for run and edit;
send "menuPick" && "Browse Tool" to button "Tools" of stack "revMenuBar"
or
send "menuPick" && "Pointer Tool" to button "Tools" of stack "revMenuBar"
Other examples;
send "menuPick" && "Dictionary (API)" to button "Help" of stack "revMenuBar"
send "menuPick" && "Backdrop" to button "View" of stack "revMenuBar"
send "menuPick" && "Save" to button "File" of stack "revMenuBar"
Warning -- Once you get into hacking the IDE, its hard to stop!
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search