Re: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Trevor DeVore via use-livecode
Ugh. I accidentally hit send before finishing the email. Here is the
finished version.

On Wed, Dec 26, 2018 at 1:09 PM Sannyasin Brahmanathaswami via use-livecode
 wrote:

>
> With that in mind, though you say "Levure doesn't have a strong opinion
> one way or the other. There is no code that is designed specifically around
> the Model-view-controller (MVC)
> pattern." I want to start using you conventions. A few more questions...
>
> 1) "to separate each stack with UI objects into a separate stack
> file and to use behaviors assigned to the card "
>
> You keep these in a separate folder, 1 per stack and behavior(s)?
>

Yes. An app that fully embraces the Levure approach has a `ui` folder which
contains any number of sub-folders. Each sub-folder has a binary stack with
the UI objects and a `behaviors` folder with any behaviors. The wiki has a
visual:

https://github.com/trevordevore/levure/wiki/ui#adding-ui-stacks


> 2) Are behaviors loaded in memory when a user loads the card and
> "unloaded" from RAM when the  users closes card? That question goes to
> performance on libraries (open at start up) versus behaviors. I don't know
> if these texts script will impact performance, relative to a JPEG that you
> bring in, or a deep dbase query... Mark once said that scripts  are not "a
> problem" but more about what they tell the CPU to do and what  UI is doing
> to the pixels on screen - Images etc. But I keep wondering about that.
>

Behaviors attached to a UI stack will be loaded when the UI stack is
loaded. If you have the `destroyStack` set to true then the stack will be
unloaded when it is closed but the behaviors will not be. Monte recently
told me about the `revbehaviourses` function which can be used to unload
behaviors which are not in use by any other stacks. There is an open issue
to add support for removing behaviors from memory when closing a stack. See
here:

https://github.com/trevordevore/levure/issues/124


> 3) What do you think of nested behaviors,  where the "uber parent" is a
> model and the child behavior is a view/UI behavior, controller VS just
> keeping that model in libraries that remain open all the time? Goes to #2
> above.
>

While I've never done it that way (I have defined my model interfaces in
library stacks out of habits established prior to behaviors) there could be
value in that approach. Take a model interface that can have multiple
instances of the model. If you use a library script you have to pass a
model instance identifier to every handler in the library. Using a behavior
script attached to a card could remove that need as each behavior has it's
own instance of the script local variables used in the model behavior
script. The approach could also simplify callbacks because the target would
always be the object the model behavior is attached to.

Nested behaviors can become complicated but your project organization can
make that easier to follow. For example, models can all be stored in a
`models` folder. In Levure the `app.yml` file would tell you if the scripts
were being loaded as libraries or behaviors. You could even be more
explicit and store them in a `behaviors/models` folder so that it was
obvious they were used as behaviors. Or in `libraries/models` if you use
the library approach. The point is, the configuration and/or structure of
your project can educate a new person about how code is being used.


> My guess is that, if the code is being reused enough, it's just a text
> file (hardly adds to the RAM) , and debugging--  also "to figure out how
> all of the code works together when you revisit the project or try to add a
> developer" -- that using a library and keeping it in a library folder,
> probably keeps it simple/more easily understood.
>

See my comments above about organizing your files. If you have clearly
organized your files and you explicitly set up nested behaviors in your
code that initializes a stack when it opens, then it may be clear enough
for a new developer. A new developer may be more likely to see the chained
behavior if the behaviors are explicitly assigned in code vs having to use
vs going to the IDE to look up what the behavior chain is.

Regarding your questions about resource usage – I haven't seen your project
but usually I'm not concerned about having library stacks used for models
sticking around. While I haven't done any tests, I would be surprised if
they made much of a difference in how your project performed. Large image
files are going to have a more significant impact.

-- 
Trevor DeVore
CTO - ScreenSteps
www.screensteps.com
___
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: Websockets Problem on LiveCode

2018-12-26 Thread Charles Warwick via use-livecode
Hi Todd,

Did you try the sample LC stack that I sent you with the socket external?  It 
allows you to send basic websocket messages to a server.  If you did try it, 
what happened?

The beta version should work on Windows, Mac and iOS (Android version is easy 
to add if needed).

Regards,

Charles

> On 27 Dec 2018, at 3:47 pm, Todd Fabacher via use-livecode 
>  wrote:
> 
> This is a 911 call for HELP from anyone.
> 
> We are using a Socket IO server. We tried using the web browser to
> send websockets messages...no problems.
> 
> but when we listen and receive the websocket message, that is where the
> problem is created. If we don't call LiveCode from the web browser, we
> don't have any issues.
> 
> But as soon as the browser calls a LiveCode function from Javascript the
> app is crashing in both iOS and Android. Sometime after 10 mins, sometimes
> after 20 mins - but it never makes it over an hour.
> 
> I assume that it is a memory leaking error. Has anyone had this problem of
> calling LiveCode function from a JavaScript function in the browser?? This
> is a HUGE problem for us as the app cannot be shipped.
> 
> Charles, you said you had a solution, but we could not get it to work.
> Maybe we were doing something wrong and you could point us in the right
> direction.
> 
> Thanks for any help,
> 
> Todd
> ___
> 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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Trevor DeVore via use-livecode
On Wed, Dec 26, 2018 at 1:09 PM Sannyasin Brahmanathaswami via use-livecode
 wrote:

>
> With that in mind, though you say "Levure doesn't have a strong opinion
> one way or the other. There is no code that is designed specifically around
> the Model-view-controller (MVC)
> pattern." I want to start using you conventions. A few more questions...
>
> 1) "to separate each stack with UI objects into a separate stack
> file and to use behaviors assigned to the card "
>
> You keep these in a separate folder, 1 per stack and behavior(s)?
>

Yes. An app that fully embraces the Levure approach has a `ui` folder which
contains any number of sub-folders. Each sub-folder has a binary stack with
the UI objects and a `behaviors` folder with any behaviors. The wiki has a
visual:

https://github.com/trevordevore/levure/wiki/ui#adding-ui-stacks


> 2) Are behaviors loaded in memory when a user loads the card and
> "unloaded" from RAM when the  users closes card? That question goes to
> performance on libraries (open at start up) versus behaviors. I don't know
> if these texts script will impact performance, relative to a JPEG that you
> bring in, or a deep dbase query... Mark once said that scripts  are not "a
> problem" but more about what they tell the CPU to do and what  UI is doing
> to the pixels on screen - Images etc. But I keep wondering about that.
>

Behaviors attached to a UI stack will be loaded when the UI stack is
loaded. If you have the `destroyStack` set to true then the stack will be
unloaded when it is closed but the behaviors will not be. Monte recently
told me about the `revbehaviourses` function which can be used to unload
behaviors which are not in use by any other stacks. There is an open issue
to add support for removing behaviors from memory when closing a stack. See
here:

https://github.com/trevordevore/levure/issues/124


> 3) What do you think of nested behaviors,  where the "uber parent" is a
> model and the child behavior is a view/UI behavior, controller VS just
> keeping that model in libraries that remain open all the time? Goes to #2
> above.
>

While I've never done it that way (I have defined my model interfaces in
library stacks out of habits established prior to behaviors) there could be
value in that approach. Take a model interface that can have multiple
instances of the model. If you use a library script you have to pass a
model instance identifier to every handler in the library. Using a behavior
script attached to a card could remove that need as each behavior has it's
own instance of the script local variables used in the model behavior
script. The approach could also simplify callbacks because the target would
always be the object the model behavior is attached to.

Nested behaviors can become complicated but your project organization can
make that easier to follow. For example, models can all be stored in a
`models` folder. Or you could store them in a `behaviors/models` folder so
that it was obvious they were used as behaviors. Or in `libraries/models

There are come designs that could be simplified The nice thing about
behaviors is that each instance has it's own script local variable values.
Depending on what your model interface looks like you might be able to do
away with having to pass an "id" to each model handler to uniquely identify
the model associated with a particular view.


> My guess is that, if the code is being reused enough, it's just a text
> file (hardly adds to the RAM) , and debugging--  also "to figure out how
> all of the code works together when you revisit the project or try to add a
> developer" -- that using a library and keeping it in a library folder,
> probably keeps it simple/more easily understood.
>
___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Trevor DeVore via use-livecode
On Wed, Dec 26, 2018 at 2:42 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Besides the impact of my current workload, I'm afraid this complexity is
> what prevented me from continuing to work on Swami's project. There are
> now
> so many disparate parts and pieces that unless you have a firm knowledge
> of
> every library and behavior script, there is no easy way to participate.

In addition, remote debugging doesn't work with script only stacks so
> that's
> an additional obstruction to overcome.
>

I thought I had used the remote debugger with iOS development before. I
just add a "debugger" line to the script and the debugger opens up. Perhaps
I'm misremembering though. What is it that doesn't work?


> I know there is enthusiasm for script only stacks and they are really
> helpful for those who use git. But when git isn't a target, the old
> fashioned way is really much easier to follow and debug.


Behaviors and script only stacks can lead to confusing designs if not
organized thoughtfully. My feeling is that either approach can lead to a
confusing architecture though. Whether you use all binary stacks or you mix
in script only stacks, a lot of it comes down to organization and the
ability to browse based on organization.

-- 
Trevor DeVore
CTO - ScreenSteps
www.screensteps.com
___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Richard Gaskin via use-livecode

J. Landman Gay jacque at hyperactivesw.com
> I know there is enthusiasm for script only stacks and they are really
> helpful for those who use git. But when git isn't a target, the old
> fashioned way is really much easier to follow and debug.

Being script-only is just the storage format on disk.  Operationally, 
stacks are stacks, regardless of the storage format.


Or maybe I misunderstand.  Is the issue with script-only stacks, or with 
deeply-nested parentScript chains?


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
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


Websockets Problem on LiveCode

2018-12-26 Thread Todd Fabacher via use-livecode
This is a 911 call for HELP from anyone.

We are using a Socket IO server. We tried using the web browser to
send websockets messages...no problems.

but when we listen and receive the websocket message, that is where the
problem is created. If we don't call LiveCode from the web browser, we
don't have any issues.

But as soon as the browser calls a LiveCode function from Javascript the
app is crashing in both iOS and Android. Sometime after 10 mins, sometimes
after 20 mins - but it never makes it over an hour.

I assume that it is a memory leaking error. Has anyone had this problem of
calling LiveCode function from a JavaScript function in the browser?? This
is a HUGE problem for us as the app cannot be shipped.

Charles, you said you had a solution, but we could not get it to work.
Maybe we were doing something wrong and you could point us in the right
direction.

Thanks for any help,

Todd
___
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


Probably a No-Brainer

2018-12-26 Thread Roger Guay via use-livecode
As an example, I want to replace the contents of a field that contains x^n with 
x^1 or x^2 or x^3 as n= 1 or 2 or 3 etc.
But I can’t seem to find find a script that works. Help please??

Roger
___
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: Image Remove Perimeter White Space

2018-12-26 Thread Ralph DiMola via use-livecode
Thanks!
I'll give it a try in the am. All of the images are 512/512 or less(icons).

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net
Phone: 518-636-3998 Ex:11
Cell: 518-796-9332


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of hh via use-livecode
Sent: Wednesday, December 26, 2018 7:58 PM
To: use-livecode@lists.runrev.com
Cc: hh
Subject: Re: Image Remove Perimeter White Space

Here is a pure LC Script handler from one of my "early" images stacks.
For large images this may become pretty slow...

## CROP image to opaque pixels
on cropIt ft
   put the width of img ft into w; put the height of img ft into h
   put the maskdata of img ft into mData
   put numToByte(0) into c0
   -- left and right transparency limits
   put w into cmin; put 1 into cmax
   repeat with i=0 to h-1
  put i*w into h1
  repeat with j=1 to cmin
 if byte h1+j of mData is not c0 then
put j into cmin; exit repeat
 end if
  end repeat
  repeat with j=w down to max(cmax,cmin)
 if byte h1+j of mData is not c0 then
put j into cmax; exit repeat
 end if
  end repeat
   end repeat
   put max(1,cmin-2) into cmin; put min(w,2+cmax) into cmax ## <- +border
   -- top and bottom transparency limits
   put h into rmin; put 1 into rmax
   repeat with j=cmin to cmax
  repeat with i=0 to rmin-1
 if byte i*w+j of mData is not c0 then
put i into rmin; exit repeat
 end if
  end repeat
  repeat with i=h-1 down to max(rmax,rmin)
 if byte i*w+j of mData is not c0 then
put i into rmax; exit repeat
 end if
  end repeat
   end repeat
   put max(1,rmin-2) into rmin; put min(h,2+rmax) into rmax ## <- +border
   put (cmax-cmin+1) into w1; put (rmax-rmin) into h1
   put the left of img ft into L; put the top of img ft into T
   crop img ft to L+cmin-1,T+rmin,L+cmax,T+rmax
   -- LC Bug: resizes instead of cropping when image has angle <> 0 end
cropIt



___
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: Image Remove Perimeter White Space

2018-12-26 Thread hh via use-livecode
Here is a pure LC Script handler from one of my "early" images stacks.
For large images this may become pretty slow...

## CROP image to opaque pixels
on cropIt ft
   put the width of img ft into w; put the height of img ft into h
   put the maskdata of img ft into mData
   put numToByte(0) into c0
   -- left and right transparency limits
   put w into cmin; put 1 into cmax
   repeat with i=0 to h-1
  put i*w into h1
  repeat with j=1 to cmin
 if byte h1+j of mData is not c0 then
put j into cmin; exit repeat
 end if
  end repeat
  repeat with j=w down to max(cmax,cmin)
 if byte h1+j of mData is not c0 then
put j into cmax; exit repeat
 end if
  end repeat
   end repeat
   put max(1,cmin-2) into cmin; put min(w,2+cmax) into cmax ## <- +border
   -- top and bottom transparency limits
   put h into rmin; put 1 into rmax
   repeat with j=cmin to cmax
  repeat with i=0 to rmin-1
 if byte i*w+j of mData is not c0 then
put i into rmin; exit repeat
 end if
  end repeat
  repeat with i=h-1 down to max(rmax,rmin)
 if byte i*w+j of mData is not c0 then
put i into rmax; exit repeat
 end if
  end repeat
   end repeat
   put max(1,rmin-2) into rmin; put min(h,2+rmax) into rmax ## <- +border
   put (cmax-cmin+1) into w1; put (rmax-rmin) into h1
   put the left of img ft into L; put the top of img ft into T
   crop img ft to L+cmin-1,T+rmin,L+cmax,T+rmax
   -- LC Bug: resizes instead of cropping when image has angle <> 0
end cropIt



___
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: Image Remove Perimeter White Space

2018-12-26 Thread hh via use-livecode
> Ralph wrote:
> I will just have to go pixel by pixel and check
> left, top, right and bottom sides for any non-zero
> RGB and delete rows/columns until one of the sides
> has an RGB that is not zero.

Here is a comparison value for that.
Using javascript from a hidden browser widget autocropping
to opaque pixels needs (incl. transport) for a 500x500 sized
image around 100 ms.


___
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: Image Remove Perimeter White Space

2018-12-26 Thread Ralph DiMola via use-livecode
Thanks All!

I was not totally clear. The area around the visible center is
transparent(not white). I need to do this invisibly in real-time without
user interaction. Luckily all the images are square so I don't have to worry
about keeping the aspect ratio intact. I will just have to go pixel by pixel
and check left, top, right and bottom sides for any non-zero RGB and delete
rows/columns until one of the sides has an RGB that is not zero.

Again... Just when I find myself "WAH"ing I remember this is LiveCode and
things like this are not so bad to code.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


___
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: Image Remove Perimeter White Space

2018-12-26 Thread J. Landman Gay via use-livecode

On 12/26/18 5:13 PM, Ralph DiMola via use-livecode wrote:

I am downloading various images from a customer with varying unpredictable
amount of white space around the image. I want to make the visible center
portion images the same size. Before I start coding is there any native LC
way or existing example stacks that do this?


If you mean to make all the images the same size and you aren't 
concerned about leaving out some content, then I'd create a temporary 
graphic with the right dimensions, center it over the loc of the 
customer image, and then:


crop img "customerImg" to the rect of grc "tempGrc"

If you want all the content to display, you can resize the longer edge 
of the image proportionately to fit inside the crop rectangle before 
cropping it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Image Remove Perimeter White Space

2018-12-26 Thread hh via use-livecode
> Ralph D.wrote
> I am downloading various images from a customer with
> varying unpredictable amount of white space around the
> image. I want to make the visible center portion images
> the same size.

Assuming the white space around is symmetric, at least proportional
to width and height, you could compute your "visible center portion"
based on the loc of the image. Then use the crop command.

The only difficulty with crop is to set the rectangle correctly. For
this, setting the topleft of the image to (0,0) is helpful for me.

For visible cropping you could wait for my cropTool that is able
to crop solid color background (with selectable tolerance). It's
coming in January 2019 (as a new years gift for the community) and
already done, needs only more help and some "beautifying".

___
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: Image Remove Perimeter White Space

2018-12-26 Thread Bob Sneidar via use-livecode
Oh that's a pickle! Nothing native I'm sure. There is no telling from the image 
itself that you want "white" to equal "overlap" at least not without a mask of 
some sort. So it's going to be a pixel by pixel job, and then hope and pray 
that "white" actually means "0,0,0" as opposed to "1,0,0" or anything else. If 
the image was produced taking into account any kind of color workflow, that 
will likely not be the case. 

I suppose a better way would be to provide the end user with some kind of crop 
tool and let them draw and scale a transparent rectangle with visible border 
and handles, then crop the imported image accordingly. 

Alternatively just require the user to provide images of a maximum width and 
height, then alert the user if they select something which exceeds the 
parameters. That is not unusual to expect that from end users. For instance, 
Toshiba's new Elevate Web Portal allow the importing of a background image and 
a company logo, but the logo must be no larger than 256x256 and the background 
must be exactly a certain size. Toshiba has no compunction requiring us to 
follow those guidelines. 

Bob S


> On Dec 26, 2018, at 15:13 , Ralph DiMola via use-livecode 
>  wrote:
> 
> I am downloading various images from a customer with varying unpredictable
> amount of white space around the image. I want to make the visible center
> portion images the same size. Before I start coding is there any native LC
> way or existing example stacks that do this?
> 
> Thanks!
> 
> Ralph DiMola


___
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


Image Remove Perimeter White Space

2018-12-26 Thread Ralph DiMola via use-livecode
I am downloading various images from a customer with varying unpredictable
amount of white space around the image. I want to make the visible center
portion images the same size. Before I start coding is there any native LC
way or existing example stacks that do this?

Thanks!

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


___
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: Navigator 6.7rc1 is available

2018-12-26 Thread Geoff Canyon via use-livecode
I updated to 6.7.1rc1 -- based on a suggestion from Sannyasin
Brahmanathaswami, selecting a script-only stack on the target menu now
immediately edits the script for that stack instead of showing it in
Navigator.

As usual, you can get Navigator here
. Or grab it
from GitHub .

On Tue, Dec 25, 2018 at 8:56 PM Geoff Canyon  wrote:

> I found out about strokeGradient, so I updated:
>
> 1. Added strokeGradient property editing, similar to fillGradient editing.
> 2. Added popups for fillGradient["type"] and strokeGradient["type"], and
> fillGradient["quality"] and strokeGradient["quality"].
> 3. Modified the property editor so start, end, via, and repeat edit inline
> instead of opening the editor.
> 4. Fixed a bug where setting the fillGradient or strokeGradient types to
> "No Gradient" failed (because that's actually an invalid value). It now
> clears the gradient properly.
>
> As usual, you can get Navigator here
> . Or grab
> it from GitHub .
>
___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread J. Landman Gay via use-livecode
Besides the impact of my current workload, I'm afraid this complexity is 
what prevented me from continuing to work on Swami's project. There are now 
so many disparate parts and pieces that unless you have a firm knowledge of 
every library and behavior script, there is no easy way to participate. In 
addition, remote debugging doesn't work with script only stacks so that's 
an additional obstruction to overcome.


I know there is enthusiasm for script only stacks and they are really 
helpful for those who use git. But when git isn't a target, the old 
fashioned way is really much easier to follow and debug.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com>

 Trevor DeVore via wrote:

   One final thought I will add is this – whatever you do come up with,
   consider if it will be understandable to you and other developers working
   on the project later on. It is possible to get so wrapped up in separation
   of code that it becomes very difficult to figure out how all of the code
   works together when you revisit the project or try to add a developer.




___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Sannyasin Brahmanathaswami via use-livecode
Happy Holidays Trevor

Thank you for the thorough response. The Levure architecture, and what we came 
up with SivaSiva app is very close. It would not really be to difficult to port 
it one day to Levure. 

With that in mind, though you say "Levure doesn't have a strong opinion one way 
or the other. There is no code that is designed specifically around the 
Model-view-controller (MVC)
pattern." I want to start using you conventions. A few more questions...

1) "to separate each stack with UI objects into a separate stack
file and to use behaviors assigned to the card "

You keep these in a separate folder, 1 per stack and behavior(s)?

2) Are behaviors loaded in memory when a user loads the card and "unloaded" 
from RAM when the  users closes card? That question goes to performance on 
libraries (open at start up) versus behaviors. I don't know if these texts 
script will impact performance, relative to a JPEG that you bring in, or a deep 
dbase query... Mark once said that scripts  are not "a problem" but more about 
what they tell the CPU to do and what  UI is doing to the pixels on screen - 
Images etc. But I keep wondering about that.

3) What do you think of nested behaviors,  where the "uber parent" is a model 
and the child behavior is a view/UI behavior, controller VS just keeping that 
model in libraries that remain open all the time? Goes to #2 above.  

My guess is that, if the code is being reused enough, it's just a text file 
(hardly adds to the RAM) , and debugging--  also "to figure out how all of the 
code works together when you revisit the project or try to add a developer" -- 
that using a library and keeping it in a library folder, probably keeps it 
simple/more easily understood.

Brahmanathaswami

 Trevor DeVore via wrote:

One final thought I will add is this – whatever you do come up with,
consider if it will be understandable to you and other developers working
on the project later on. It is possible to get so wrapped up in separation
of code that it becomes very difficult to figure out how all of the code
works together when you revisit the project or try to add a developer.
Search for the right balance.

___
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

FrameTalkHTML5_v100

2018-12-26 Thread hh via use-livecode
FrameTalkHTML5 is my end-of-year gift 2018 to the community.

It is a HTML5 standalone that can talk (send/ receive messages)
to other instances of itself in frames of the same browser window.
The instances of the standalone can come from different (local or
remote) servers.

The "installation" uses "postMessage" on the javaScript side and a
javascriptHandler of the HTML5-standalone on the LC side.

[1] Use the 2x2 demo "FrameTalkHTML5" from a browser widget.
This is available from "Sample Stacks" or from
http://livecodeshare.runrev.com/stack/923

The sample-stack contains a browser widget that loads the four frames
from two different servers.

 You can moreover talk from/to the stack to/from each of the
 four frames displayed in the widget.

The stack has large help (incl. the URL of the source code of the
HTLM5 standalone used in the frames).

[2] Call a 2x2-demo "FrameTalkHTML5" in your (ordinary) browser
from the index (scroll to bottom),
see
(EU) http://hyperhh.de/html5/index-large.html 
or
(US) http://hh.on-rev.com/html5/index-large.html

In this versions the "top" (the frameset) simply answers back a
'Got it' to the sending standalone into its frame.


p.s. Santas are busy again until 2019 :-)
see
http://hyperhh.de/html5/SantasAreBusy-9.0.0-dp-4X.html
or
http://hh.on-rev.com/html5/SantasAreBusy-9.0.0-dp-4X.html


___
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: Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Trevor DeVore via use-livecode
On Wed, Dec 26, 2018 at 8:44 AM Sannyasin Brahmanathaswami via use-livecode
 wrote:

> Always interest in improving (often terrifying beginning) my architecture,
> having read Andre's book on MVC.  It comes to mind that we could use a
> standard structure, like
>
> 1) Card or Group
> 2) Assigned in a unique view e.g. "behavior_viewHomeStory"
> * handles the controls on the card and group
> 3) Assigned to that a Parent Behavios (nested)  general model e.g.
> "behavior_modelNarrative"
>   * handles getting quotes from database; XML/JSON from servers,
>
> and it this case
>
> --any "style" sheet assigned to the "stories" with should be used
> everywhere -- might consider a "view" component, but the style "brief"
> should be followed (mostly) everywhere app.. for things like quotes, pull
> Quote, headline, type faces.. it seems to be a "model" ... which could be
> over ridden with handlers  in the view script #2, as needed
> # 3 can to generalized and used everywhere.
>
> Anyone doing "Levure"? How does Levure handle this?
>

Levure doesn't have a strong opinion one way or the other. There is no code
that is designed specifically around the Model-view-controller (MVC)
pattern. Levure helps you organize existing LiveCode features such as
libraries, behaviors, frontscripts/backscripts, widgets, and stacks with UI
elements.

That being said, Levure certainly encourages some of the MVC principles. If
you organize your stack files the way that Levure suggests then your code
will be separated from stacks with UI objects. For example, Levure
encourages you to separate each stack with UI objects into a separate stack
file and to use behaviors assigned to the card so that your code is stored
outside of the stack file. This separates your view (the UI elements) from
the controller (the card script stored in the behavior) and facilitates
simultaneous development between more than one developer. If your model
code is located in a library stack file then that code is stored separately
from the controller and view (stacks with UI objects and their behavior
scripts). Even if you decide to move some controller code into it's own
library stack file than the controller code remains independent of the
model and view.

Overall Levure doesn't try to force you into designing your app a certain
way. It encourages you to organize your application in a certain way and it
provides the Levure Helper interface. This organization allows Levure to
automate a number of things for you during the authoring and distribution
stages. It also helps you keep your sanity as you work on an app, as well
as when you return to the project months (or years) later after not having
looked at the code. The Levure Helper interface allows powerful features to
be added to a Levure application in a very straightforward way without
causing bloat within Levure itself.

Levure could certainly be extended via a helper(s) to add features specific
to MVC. Levure Helpers allow a developer to extend Levure in any number of
ways. If a developer came up with an MVC approach in LiveCode that required
libraries, frontscripts, certain configuration options, plugins or handlers
for use while working in the IDE, etc. then that functionality could be
wrapped up into a Levure Helper and dropped into an app. For example, I
have a helper I use internally that adds support for something I call
embeddable views. It allows me to treat groups that are on a card as their
own distinct stacks during development. It does this by automatically
updating the card whenever the stack representing the embeddable view is
saved. The helper also performs some operations when the application is
packaged for distribution. While this functionality is outside the scope of
Levure itself, it wouldn't be nearly as easy to implement without the
Levure app.yml configuration file and the hooks that Levure provides when
packaging an application for distribution.

One final thought I will add is this – whatever you do come up with,
consider if it will be understandable to you and other developers working
on the project later on. It is possible to get so wrapped up in separation
of code that it becomes very difficult to figure out how all of the code
works together when you revisit the project or try to add a developer.
Search for the right balance.

-- 
Trevor DeVore
CTO - ScreenSteps
www.screensteps.com
___
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: Versions 7.1.1 and 8.1.3 no long working properly

2018-12-26 Thread Richmond Mathewson via use-livecode
Yesterday I woke my Mac mini running 10.14.2 from sleep and got nothing but
'snow' on the monitor. Turning off all 'sleep' settings solved the problem.

Richmond.

On Wed, Dec 26, 2018, 5:53 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Curious. I woke up my Mac with 10.14.2 with an external monitor plugged
> in. The laptop monitor backlight lit, but no image was displayed. Rebooting
> resolved the issue.
>
> Bob S
>
>
> > On Dec 22, 2018, at 03:19 , JJS via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I've read that 10.14.3 will come in Januray or february.
> >
> > Mojave 10.14 did strange thing on my hackintosh too, so i downgraded to
> High sierra latest version 10.13.6
> >
> > From corrupted downloads to other strange things.
> >
> > Now there is an update to 10.14.2, but it also did not work to update
> correct to that version from 10.14.
>
>
> ___
> 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: Versions 7.1.1 and 8.1.3 no long working properly

2018-12-26 Thread Bob Sneidar via use-livecode
Curious. I woke up my Mac with 10.14.2 with an external monitor plugged in. The 
laptop monitor backlight lit, but no image was displayed. Rebooting resolved 
the issue. 

Bob S


> On Dec 22, 2018, at 03:19 , JJS via use-livecode 
>  wrote:
> 
> I've read that 10.14.3 will come in Januray or february.
> 
> Mojave 10.14 did strange thing on my hackintosh too, so i downgraded to High 
> sierra latest version 10.13.6
> 
> From corrupted downloads to other strange things.
> 
> Now there is an update to 10.14.2, but it also did not work to update correct 
> to that version from 10.14.


___
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


Musings on Architect, MVC, Nested Behaviors

2018-12-26 Thread Sannyasin Brahmanathaswami via use-livecode
Always interest in improving (often terrifying beginning) my architecture, 
having read Andre's book on MVC.  It comes to mind that we could use a standard 
structure, like  

1) Card or Group
2) Assigned in a unique view e.g. "behavior_viewHomeStory"
* handles the controls on the card and group
3) Assigned to that a Parent Behavios (nested)  general model e.g. 
"behavior_modelNarrative"
  * handles getting quotes from database; XML/JSON from servers, 

and it this case

--any "style" sheet assigned to the "stories" with should be used everywhere -- 
might consider a "view" component, but the style "brief" should be followed 
(mostly) everywhere app.. for things like quotes, pull Quote, headline, type 
faces.. it seems to be a "model" ... which could be over ridden with handlers  
in the view script #2, as needed 
# 3 can to generalized and used everywhere.

Anyone doing "Levure"? How does Levure handle this?

BR


___
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: LC-apps for HC

2018-12-26 Thread Ingar Roggen via use-livecode
Richmond
I must have been sleeping at the time of your offer. Sorry! — When Andy right 
now offers his whole bundle at Xmas prices I would gladly buy it all. I hope he 
reads this. BUT ONLY IF it helps to bridge and bond HC with LC! Including the 
complete original MacPaint. — In order not to clutter up this list I stop here 
and refer you here to a pdf with a sketch of my own solution: 
roggen.no/HC+LC.pdf and a pdf with my mind-hologram 
for a CyberMentat:roggen.no/inner.
Merry Xmas to all of you!
Ingar

3. des. 2018 kl. 10.15 skrev Richmond via use-livecode 
mailto:use-livecode@lists.runrev.com>>:

Did exactly that a couple of years ago . . . .

No takers at the time.

Richmond.

On 3.12.18 г. 3:55 ч., Richard Gaskin via use-livecode wrote:
Ingar Roggen:

> ...why not elaborate it to the tool, the app needed to make HC easily
> portable to LC and thereby accessible "to the rest of us" again?
> Anybody takes the challenge?

One could make HC's interface in LC. Anyone game?

I once thought about doing it myself...
http://livecodejournal.com/features/the-true-power-of-hypercard.html



___
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

[ANN] 30% End of Year discount on my new book and tools

2018-12-26 Thread Andre Alves Garzia via use-livecode

Hi Friends,

Following LiveCode fantastic end of year promotions of 30% discount on a 
ton of stuff and since it is boxing day here in the UK, I decided to 
create a end of year promotion of my own. Starting today and going until 
the end of the year, there is a 30% discount on the following items by 
using the coupon code ENDOFYEAR2018:



# Bundle of "The Book + Network Tracer + DB Lib + AAG Tools"

- Usually GBP 100 (which already is 30% discount on the sum of the 
products) will go for GBP 70.


- Direct Purchase link: https://sowl.co/BAAZl


# LiveCode Advanced Application Architecture Book

- Normally a GBP 15 value, goes for GBP 10.50.

- Direct Purchase link: https://sowl.co/cqnKW


# Network Tracer

- Normally GBP 40, with discount GBP 28.

- Direct Purchase link: https://sowl.co/tqAlD


# DB Lib

- Normally GBP 60, with discount GBP 42.

- Direct Purchase link: https://sowl.co/YpT7k


To get the discount you need to apply a coupon code at the payment 
screen, the coupon code is: ENDOFYEAR2018


More information about all those items is available from my site: 
http://andregarzia.com/livecode


Cheers

andre





___
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