Re: Fat widgets

2017-07-09 Thread Matthias Rebbe via use-livecode
Thanks Kevin. That´s working. To be honest, i did not know this command until 
your post.

Regards,
Matthias

Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu ‌

> Am 08.07.2017 um 19:37 schrieb Kevin Miller via use-livecode 
> >:
> 
> I haven't encountered this because our widgets are a library. But - I'm 
> guessing - you could try the revert command?
> 
> Sent from my iPhone
> 
>> On 8 Jul 2017, at 15:49, Matthias Rebbe via use-livecode 
>> > wrote:
>> 
>> Thank you very much. :)
>> 
>> This makes it so much easier to test stacks between 8 and 9.
>> 
>> I had to make some adjustments, because the source of my extensions is 
>> stored somewhere else and the updateMessage is also not present.
>> I get the widget recompiled when i load the stack, but the widget in the 
>> stack still does not show up correctly. I have to unload and reload the 
>> stack again.
>> Can i somehow refresh the stack w/o having to unload and load again?
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Fat widgets

2017-07-08 Thread Kevin Miller via use-livecode
I haven't encountered this because our widgets are a library. But - I'm 
guessing - you could try the revert command?

Sent from my iPhone

> On 8 Jul 2017, at 15:49, Matthias Rebbe via use-livecode 
>  wrote:
> 
> Thank you very much. :)
> 
> This makes it so much easier to test stacks between 8 and 9.
> 
> I had to make some adjustments, because the source of my extensions is stored 
> somewhere else and the updateMessage is also not present.
> I get the widget recompiled when i load the stack, but the widget in the 
> stack still does not show up correctly. I have to unload and reload the stack 
> again.
> Can i somehow refresh the stack w/o having to unload and load again?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Fat widgets

2017-07-08 Thread hh via use-livecode
Thank you very much for that.

This solves the situation where the LC-8 version and the LC-9 version are the
same (have the same lcb file). 
Thus you can only have widgets that use LCB-syntax/features that are present
in both LC-8 and LC-9, especially no new/different LCB features from LC-9.

> Kevin wrote:
> I don¹t see why not:
> 
> on openStack
>-- Build widgets and libraries
>if the environment is "development" then
>   _checkExtension _rootFolder() & "/extensions/com.library.folder.here"
> -- insert any others here
> end if
> 
> end openStack
> 
> --
> -- Remove all the files with the extension pExtension in the
> -- current directory
> --
> command _removeExtension pExtension
>get "find . -depth 1 -name " & quote & "*." & pExtension & quote && "
> -exec rm {} \;"
>get shell(it)
> end _removeExtension
> --
> -- _checkExtension pFolder
> --
> -- Proceed to build and install the extension in pFolder if need be
> --
> command _checkExtension pFolder
>local tOldFolder, tFiles
>local tExtensionFolder
>
>set the itemDel to slash
>
>put item -1 of pFolder into tExtensionFolder
>
>put the defaultFolder into tOldFolder
>set the defaultFolder to pFolder
>
>put the detailed files into tFiles
>
>set the itemDel to comma
>
>local tPackageTime, tLcbTime, tPackageName
>
>repeat for each line tFile in tFiles
>   local tFilename
>   put urlDecode(item 1 of tFile) into tFilename
>   
>   if tFilename ends with ".lce" then
>  -- Get the last modification date of the package
>  put item 5 of tFile into tPackageTime
>  put urlDecode(tFilename) into tPackageName
>  
>   else if tFilename ends with ".lcb" then
>  -- LCB file we want to check
>  put item 5 of tFile into tLcbTime
>   end if
>end repeat
>
>-- Guess the extension name from the folder - only take the
>-- first 4 segments, as orientabletext folder, for instance,
>-- also has the version appended to the widget name
>local tExtensionName
>set the itemDel to "."
>put item 1 to 4 of tExtensionFolder into tExtensionName
>
>if tPackageTime is empty or tPackagetime < tLcbTime or \
>  tExtensionName is not among the lines of the loadedExtensions then
>   -- Missing or outdated extension package, or extension not loaded
>   updateMessage "Building and installing extension" && tExtensionFolder
>   
>   _removeExtension "lci"
>   _removeExtension "lce"
>   _removeExtension "lcm"
>   _removeExtension "xml"
>   
>   -- Make sure to remove the extension beforehand, installation does
> not
>   -- work properly if the extension already exists
>   revIDEDeveloperExtensionUninstall pFolder
>   
>   wait 500 milliseconds with messages
>   
>   revIDEDeveloperExtensionInstall pFolder
>   
>   load extension from file tPackageName
>   
>   -- Let the IDE load the extension
>   wait 500 milliseconds with messages
>end if
>
>set the defaultFolder to tOldFolder
> end _checkExtension
> 
> --
> -- _rootFolder
> --
> -- Return the root folder of the application
> --
> function _rootFolder
>if the environment is "development" then
>   set the itemDel to slash
>   return item 1 to -3 of the filename of me
>   
>else
>   return specialFolderPath("engine")
>end if
> end _rootFolder

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Fat widgets

2017-07-08 Thread Matthias Rebbe via use-livecode
Thank you very much. :)

This makes it so much easier to test stacks between 8 and 9.

I had to make some adjustments, because the source of my extensions is stored 
somewhere else and the updateMessage is also not present.
I get the widget recompiled when i load the stack, but the widget in the stack 
still does not show up correctly. I have to unload and reload the stack again.
Can i somehow refresh the stack w/o having to unload and load again?

Matthias

Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu ‌

> Am 08.07.2017 um 15:43 schrieb Kevin Miller via use-livecode 
> >:
> 
> I don¹t see why not:
> 
> on openStack
>   -- Build widgets and libraries
>   if the environment is "development" then
>  _checkExtension _rootFolder() & "/extensions/com.library.folder.here"
> -- insert any others here
> end if
> 
> end openStack
> 
> --
> -- Remove all the files with the extension pExtension in the
> -- current directory
> --
> command _removeExtension pExtension
>   get "find . -depth 1 -name " & quote & "*." & pExtension & quote && "
> -exec rm {} \;"
>   get shell(it)
> end _removeExtension
> --
> -- _checkExtension pFolder
> --
> -- Proceed to build and install the extension in pFolder if need be
> --
> command _checkExtension pFolder
>   local tOldFolder, tFiles
>   local tExtensionFolder
> 
>   set the itemDel to slash
> 
>   put item -1 of pFolder into tExtensionFolder
> 
>   put the defaultFolder into tOldFolder
>   set the defaultFolder to pFolder
> 
>   put the detailed files into tFiles
> 
>   set the itemDel to comma
> 
>   local tPackageTime, tLcbTime, tPackageName
> 
>   repeat for each line tFile in tFiles
>  local tFilename
>  put urlDecode(item 1 of tFile) into tFilename
> 
>  if tFilename ends with ".lce" then
> -- Get the last modification date of the package
> put item 5 of tFile into tPackageTime
> put urlDecode(tFilename) into tPackageName
> 
>  else if tFilename ends with ".lcb" then
> -- LCB file we want to check
> put item 5 of tFile into tLcbTime
>  end if
>   end repeat
> 
>   -- Guess the extension name from the folder - only take the
>   -- first 4 segments, as orientabletext folder, for instance,
>   -- also has the version appended to the widget name
>   local tExtensionName
>   set the itemDel to "."
>   put item 1 to 4 of tExtensionFolder into tExtensionName
> 
>   if tPackageTime is empty or tPackagetime < tLcbTime or \
> tExtensionName is not among the lines of the loadedExtensions then
>  -- Missing or outdated extension package, or extension not loaded
>  updateMessage "Building and installing extension" && tExtensionFolder
> 
>  _removeExtension "lci"
>  _removeExtension "lce"
>  _removeExtension "lcm"
>  _removeExtension "xml"
> 
>  -- Make sure to remove the extension beforehand, installation does
> not
>  -- work properly if the extension already exists
>  revIDEDeveloperExtensionUninstall pFolder
> 
>  wait 500 milliseconds with messages
> 
>  revIDEDeveloperExtensionInstall pFolder
> 
>  load extension from file tPackageName
> 
>  -- Let the IDE load the extension
>  wait 500 milliseconds with messages
>   end if
> 
>   set the defaultFolder to tOldFolder
> end _checkExtension
> 
> --
> -- _rootFolder
> --
> -- Return the root folder of the application
> --
> function _rootFolder
>   if the environment is "development" then
>  set the itemDel to slash
>  return item 1 to -3 of the filename of me
> 
>   else
>  return specialFolderPath("engine")
>   end if
> end _rootFolder
> 
> 
> Kind regards,
> 
> Kevin
> 
> Kevin Miller ~ ke...@livecode.com  ~ 
> http://www.livecode.com/ 
> LiveCode: Everyone can create apps
> 
> 
> 
> 
> On 08/07/2017, 14:30, "use-livecode on behalf of Matthias Rebbe via
> use-livecode"   on behalf of
> use-livecode@lists.runrev.com > wrote:
> 
>> Kevin,
>> 
>> is it possible to get that script or is it not for the public?
>> 
>> Regards,
>> Matthias
>> 
>> Matthias Rebbe
>> +49 5741 31
>> matthiasrebbe.eu  > >
>> 
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: Fat widgets

2017-07-08 Thread Kevin Miller via use-livecode
I don¹t see why not:

on openStack
   -- Build widgets and libraries
   if the environment is "development" then
  _checkExtension _rootFolder() & "/extensions/com.library.folder.here"
-- insert any others here
end if

end openStack

--
-- Remove all the files with the extension pExtension in the
-- current directory
--
command _removeExtension pExtension
   get "find . -depth 1 -name " & quote & "*." & pExtension & quote && "
-exec rm {} \;"
   get shell(it)
end _removeExtension
--
-- _checkExtension pFolder
--
-- Proceed to build and install the extension in pFolder if need be
--
command _checkExtension pFolder
   local tOldFolder, tFiles
   local tExtensionFolder
   
   set the itemDel to slash
   
   put item -1 of pFolder into tExtensionFolder
   
   put the defaultFolder into tOldFolder
   set the defaultFolder to pFolder
   
   put the detailed files into tFiles
   
   set the itemDel to comma
   
   local tPackageTime, tLcbTime, tPackageName
   
   repeat for each line tFile in tFiles
  local tFilename
  put urlDecode(item 1 of tFile) into tFilename
  
  if tFilename ends with ".lce" then
 -- Get the last modification date of the package
 put item 5 of tFile into tPackageTime
 put urlDecode(tFilename) into tPackageName
 
  else if tFilename ends with ".lcb" then
 -- LCB file we want to check
 put item 5 of tFile into tLcbTime
  end if
   end repeat
   
   -- Guess the extension name from the folder - only take the
   -- first 4 segments, as orientabletext folder, for instance,
   -- also has the version appended to the widget name
   local tExtensionName
   set the itemDel to "."
   put item 1 to 4 of tExtensionFolder into tExtensionName
   
   if tPackageTime is empty or tPackagetime < tLcbTime or \
 tExtensionName is not among the lines of the loadedExtensions then
  -- Missing or outdated extension package, or extension not loaded
  updateMessage "Building and installing extension" && tExtensionFolder
  
  _removeExtension "lci"
  _removeExtension "lce"
  _removeExtension "lcm"
  _removeExtension "xml"
  
  -- Make sure to remove the extension beforehand, installation does
not
  -- work properly if the extension already exists
  revIDEDeveloperExtensionUninstall pFolder
  
  wait 500 milliseconds with messages
  
  revIDEDeveloperExtensionInstall pFolder
  
  load extension from file tPackageName
  
  -- Let the IDE load the extension
  wait 500 milliseconds with messages
   end if
   
   set the defaultFolder to tOldFolder
end _checkExtension

--
-- _rootFolder
--
-- Return the root folder of the application
--
function _rootFolder
   if the environment is "development" then
  set the itemDel to slash
  return item 1 to -3 of the filename of me
  
   else
  return specialFolderPath("engine")
   end if
end _rootFolder


Kind regards,

Kevin

Kevin Miller ~ ke...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




On 08/07/2017, 14:30, "use-livecode on behalf of Matthias Rebbe via
use-livecode"  wrote:

>Kevin,
>
>is it possible to get that script or is it not for the public?
>
>Regards,
>Matthias
>
>Matthias Rebbe
>+49 5741 31
>matthiasrebbe.eu 
>



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Fat widgets

2017-07-08 Thread Matthias Rebbe via use-livecode
Kevin,

is it possible to get that script or is it not for the public?

Regards,
Matthias

Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌

> Am 08.07.2017 um 12:32 schrieb Kevin Miller via use-livecode 
> <use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>:
> 
> What we do one one large project that uses widgets and moves between 8 and
> 9 is to automatically recompile them on startup using a script. The logic
> is simple - if a try determines the widget library functions are not
> running and available, uninstall the widget, recompile it and reinstall
> it. Its pretty much instant to do that and its mean that (in this project
> at least) we¹ve stopped thinking about this issue.
> 
> Kind regards,
> 
> Kevin
> 
> Kevin Miller ~ ke...@livecode.com <mailto:ke...@livecode.com> ~ 
> http://www.livecode.com/ <http://www.livecode.com/>
> LiveCode: Everyone can create apps
> 
> 
> 
> 
> On 08/07/2017, 11:22, "use-livecode on behalf of hh via use-livecode"
> <use-livecode-boun...@lists.runrev.com 
> <mailto:use-livecode-boun...@lists.runrev.com> on behalf of
> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>> wrote:
> 
>> This is the current situation:
>> [*] A stack that contains a widget that is compiled with LC 8.1.5
>> can not be used with any other LC version than LC 8.1.5,
>> [*] A stack that contains a widget that is compiled with LC 9.0.0
>> can not be used with any other LC version than LC 9.0.0
>> 
>> Mark Waddingham did recently already post thoughts to that here (see
>> below).
>> 
>> Option (1) below is the build of "fat widgets" that contain several
>> binaries,
>> one for each currently valid widget format. Would be great, thus one
>> could be
>> "downward compatible" in LC 8/9.
>> 
>> Is there any chance to enable such "fat widgets" in the short future?
>> [And how is this solved for the current company-widgets (Clock etc.)?]
>> 
>>> On Jun 16, 2017; 11:10 Mark wrote:
>>>> [MatthiasRebbe wrote:] Mark,
>>>> regarding to recompiling widget for newer LC version:
>>>> If i use LC 8 and 9, do i have to recompile it every time i use the
>>>> other version?
>>> 
>>> Right now - yes - the lcm (compiled LCB) formats are not compatible.
>>> 
>>> There are a couple of potential solutions:
>>> 
>>> 1) Make it so that multiple LCM versions can sit in the same extension.
>>> We can package up the lcb toolchain for each version as a distinct
>>> download to help with this.
>>> 
>>> 2) Have a plugin in the IDE which fetches a git repo containing a widget
>>> (or widgets) and compiles them locally. lc-compile is really lightweight
>>> and bundled into the IDE so doing this automatically is quite
>>> straight-forward.
>>> 
>>> Case (1) would work for people wanting to distribute lce files which
>>> people can just install on their machine. Case (2) is suitable
>>> particularly for community widgets - it would mean that anyone
>>> subscribing to a particular 'widget repo' could get updates as soon as
>>> they are pushed by the maintainer.
>>> 
>>> I think it is worth doing (1) regardless - it is a simple matter of
>>> having say 'module.8.lcm' and 'module.9.lcm' files. The 9 format is
>>> unstable until we go GM, but the 8 format is now 'stable' - i.e. won't
>>> change ever again.
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Fat widgets

2017-07-08 Thread Kevin Miller via use-livecode
What we do one one large project that uses widgets and moves between 8 and
9 is to automatically recompile them on startup using a script. The logic
is simple - if a try determines the widget library functions are not
running and available, uninstall the widget, recompile it and reinstall
it. Its pretty much instant to do that and its mean that (in this project
at least) we¹ve stopped thinking about this issue.

Kind regards,

Kevin

Kevin Miller ~ ke...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




On 08/07/2017, 11:22, "use-livecode on behalf of hh via use-livecode"
<use-livecode-boun...@lists.runrev.com on behalf of
use-livecode@lists.runrev.com> wrote:

>This is the current situation:
>[*] A stack that contains a widget that is compiled with LC 8.1.5
>can not be used with any other LC version than LC 8.1.5,
>[*] A stack that contains a widget that is compiled with LC 9.0.0
>can not be used with any other LC version than LC 9.0.0
>
>Mark Waddingham did recently already post thoughts to that here (see
>below).
>
>Option (1) below is the build of "fat widgets" that contain several
>binaries,
>one for each currently valid widget format. Would be great, thus one
>could be
>"downward compatible" in LC 8/9.
>
>Is there any chance to enable such "fat widgets" in the short future?
>[And how is this solved for the current company-widgets (Clock etc.)?]
>
>> On Jun 16, 2017; 11:10 Mark wrote:
>> > [MatthiasRebbe wrote:] Mark,
>> > regarding to recompiling widget for newer LC version:
>> > If i use LC 8 and 9, do i have to recompile it every time i use the
>> > other version?
>> 
>> Right now - yes - the lcm (compiled LCB) formats are not compatible.
>> 
>> There are a couple of potential solutions:
>> 
>> 1) Make it so that multiple LCM versions can sit in the same extension.
>> We can package up the lcb toolchain for each version as a distinct
>> download to help with this.
>> 
>> 2) Have a plugin in the IDE which fetches a git repo containing a widget
>> (or widgets) and compiles them locally. lc-compile is really lightweight
>> and bundled into the IDE so doing this automatically is quite
>> straight-forward.
>> 
>> Case (1) would work for people wanting to distribute lce files which
>> people can just install on their machine. Case (2) is suitable
>> particularly for community widgets - it would mean that anyone
>> subscribing to a particular 'widget repo' could get updates as soon as
>> they are pushed by the maintainer.
>> 
>> I think it is worth doing (1) regardless - it is a simple matter of
>> having say 'module.8.lcm' and 'module.9.lcm' files. The 9 format is
>> unstable until we go GM, but the 8 format is now 'stable' - i.e. won't
>> change ever again.
>
>___
>use-livecode mailing list
>use-livecode@lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Fat widgets

2017-07-08 Thread hh via use-livecode
This is the current situation:
[*] A stack that contains a widget that is compiled with LC 8.1.5
can not be used with any other LC version than LC 8.1.5,
[*] A stack that contains a widget that is compiled with LC 9.0.0
can not be used with any other LC version than LC 9.0.0

Mark Waddingham did recently already post thoughts to that here (see below).

Option (1) below is the build of "fat widgets" that contain several binaries,
one for each currently valid widget format. Would be great, thus one could be
"downward compatible" in LC 8/9.

Is there any chance to enable such "fat widgets" in the short future?
[And how is this solved for the current company-widgets (Clock etc.)?]

> On Jun 16, 2017; 11:10 Mark wrote:
> > [MatthiasRebbe wrote:] Mark,
> > regarding to recompiling widget for newer LC version:
> > If i use LC 8 and 9, do i have to recompile it every time i use the
> > other version?
> 
> Right now - yes - the lcm (compiled LCB) formats are not compatible.
> 
> There are a couple of potential solutions:
> 
> 1) Make it so that multiple LCM versions can sit in the same extension.
> We can package up the lcb toolchain for each version as a distinct
> download to help with this.
> 
> 2) Have a plugin in the IDE which fetches a git repo containing a widget
> (or widgets) and compiles them locally. lc-compile is really lightweight
> and bundled into the IDE so doing this automatically is quite
> straight-forward.
> 
> Case (1) would work for people wanting to distribute lce files which
> people can just install on their machine. Case (2) is suitable
> particularly for community widgets - it would mean that anyone
> subscribing to a particular 'widget repo' could get updates as soon as
> they are pushed by the maintainer.
> 
> I think it is worth doing (1) regardless - it is a simple matter of
> having say 'module.8.lcm' and 'module.9.lcm' files. The 9 format is
> unstable until we go GM, but the 8 format is now 'stable' - i.e. won't
> change ever again.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode