I can't seem to get this working.
How do I add custom handlers to the handler list? Or builtin handlers for that matter?
Default handler list
Default handler list
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Default handler list
Import examples:
use com.livecode.math
use com.livecode.library.iconsvg
In case you mean with "custom handlers" public handlers of other widgets:
Such handlers aren't really "public". This is not (yet) implemented in LCB.
use com.livecode.math
use com.livecode.library.iconsvg
In case you mean with "custom handlers" public handlers of other widgets:
Such handlers aren't really "public". This is not (yet) implemented in LCB.
shiftLock happens
Re: Default handler list
As an example, on the "Segmented Control" widget, there is the "hiliteChanged" handler, and on the "Tree View" widget there is "actionDoubleClick, actionInspect, dataChanged, hiliteChanged" handlers listed.
I would like to add handlers such as these to the list on the left when I open the script editor for one.
I would like to add handlers such as these to the list on the left when I open the script editor for one.
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Default handler list
There is no direct connection between LCS editor and LCB-widgets.
The only way I can see is that you build a template with all the properties (may be based on the manifest.xml file of the widget) and set the script of an LCS object to that template.
For adding handlers to the "insert"-List you have to dive into the IDE.
Probably you can use the menu action of the LC menu "Handler/Add default handler ..."
The only way I can see is that you build a template with all the properties (may be based on the manifest.xml file of the widget) and set the script of an LCS object to that template.
For adding handlers to the "insert"-List you have to dive into the IDE.
Probably you can use the menu action of the LC menu "Handler/Add default handler ..."
shiftLock happens
Re: Default handler list
Those examples are messages that the widget sends. You should be able to add them just like the LC default widgets. They are included in the docs at the top of the widget.
The default script/comments appear to be copied from support/defaultscript.livecodescript for each handler that is added.
The default script/comments appear to be copied from support/defaultscript.livecodescript for each handler that is added.
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Default handler list
I now followed the defaultscript generating for a widget in detail.
[1] There is probably a problem with
Tools/Toolset/libraries/revidedeveloperextensionlibrary.livecodescript, line 639:I think this should read "DefaultScript" instead of ".__DefaultScript"
This may be the reason why a default script is found not before a second edit in the Extension Builder. But it has no influence on installing a widget.
[2] The installation of the widget runs correctly and the defaultscript.livecode file has the expected path.
[3] The defaultscript doesn't load correctly into the cache:
In file Tools/Toolset/libraries/revideextensionlibrary.livecodescript the defaultscript is correctly loaded (I checked manually with revIDEExtensionFetchDefaultScript**) and set as key, line 1170:
But I couldn't get it as key, so there may be a problem with the cache building. I don't know where. (Of course I removed the cache and looked into a fresh build of it).
__
** For example from the message box:
put "/Users/admin/Documents/My LiveCode/Extensions/community.livecode.hermann.graphicswidget.1.0.0" into tFolder
put revIDEExtensionFetchDefaultScript(tFolder)
So we can (at least for testing) edit tFolder/support/defaultscript.livecodescript with a texteditor and revIDEExtensionFetchDefaultScript(tFolder) loads it.
[1] There is probably a problem with
Tools/Toolset/libraries/revidedeveloperextensionlibrary.livecodescript, line 639:
Code: Select all
put sExtensionDetailsA[pFolder]["name"] & ".__DefaultScript" into tExpectedName
This may be the reason why a default script is found not before a second edit in the Extension Builder. But it has no influence on installing a widget.
[2] The installation of the widget runs correctly and the defaultscript.livecode file has the expected path.
[3] The defaultscript doesn't load correctly into the cache:
In file Tools/Toolset/libraries/revideextensionlibrary.livecodescript the defaultscript is correctly loaded (I checked manually with revIDEExtensionFetchDefaultScript**) and set as key, line 1170:
Code: Select all
put revIDEExtensionFetchDefaultScript(pFolder, pID, true) into tDefaultScript
__extensionPropertySet tCacheIndex, "defaultScript", tDefaultScript
__
** For example from the message box:
put "/Users/admin/Documents/My LiveCode/Extensions/community.livecode.hermann.graphicswidget.1.0.0" into tFolder
put revIDEExtensionFetchDefaultScript(tFolder)
So we can (at least for testing) edit tFolder/support/defaultscript.livecodescript with a texteditor and revIDEExtensionFetchDefaultScript(tFolder) loads it.
shiftLock happens