Finally it is very simple to make a fat widget (avoiding automatic recompilation).
Do the following in the folder of your lcb-file.
- Make your lcb file run in both LC 8 and LC 9 (latest stable versions).
- Test the lcb-file in LC 8.
(This generates several other files and module.lcm)
Close LC 8. - Test the lcb-file in LC 9.
(This generates several other files, some are overwritten, and module.2.lcm)
Package the widget in LC 9 (button at bottom left).
If you wish to make a sample stack with an installer then add a button (say named "install") with the following script.
Code: Select all
on mouseUp b
if b=3 then -- set the widget as custom property
answer file "Locate the *lce* file of the fat LC 8/9 widget"
if it is empty then exit mouseUp
set itemdel to slash
set the widgetLCE of me to item -1 of it
set itemdel to comma
put url("binfile:"&it) into f
set the dateWidget of me to f
else -- install from the custom property
set cursor to watch
put the dateWidget of me into bb
put the widgetLCE of me into lce
put the temporary folder & lce into tgt
put bb into URL("binfile:"& tgt)
if char 1 of the version is "9" then
revIDEExtensionInstall tgt, "widget"
else
revIDEInstallExtension tgt, "widget"
end if
wait 1 second with messages
delete file tgt
answer "You have to quit and restart LiveCode now." \
with "Cancel" or "Quit" as sheet
if it is "Quit" then quit
end if
end mouseUp
- RightClick the button and locate the fat lce-file
(this puts the file contents into a custom property). - SAVE the stack.
- Click the button to install the fat widget.
- Restart LiveCode.
Code: Select all
local wdgt="...." #<-- insert the kind of your widget
on mouseUp b
if char 1 of the version is "9" then
revIDEExtensionUninstall wdgt
else
revIDEUnInstallExtension wdgt
end if
wait 1 second with messages
answer "" & \
"Please save the scripts of your widgets before deleting them." &cr& \
"Then you have to quit and restart LiveCode for a clean work." \
with "Cancel" or "Quit" as sheet
if it is "Quit" then quit
end mouseUp
Thanks to Brian Milby for valuable hints to the above and thanks to the team for the great improvements of the Extension Manager and the Extension Builder.