Re: Datagrid internal error

2022-08-10 Thread Trevor DeVore via use-livecode
32,767 is the max for width as well. If there are enough columns it is
possible that the DataGrid is rendering a group that exceeds this limit and
hence the error. The DataGrid works around the limit when rendering rows,
but not when rendering columns.

I suppose a quick test would be to create a DataGrid with 330 columns that
are at least 100 pixels wide and see if you get the same error.

-- 
Trevor DeVore
ScreenSteps

On Mon, Aug 8, 2022 at 12:36 PM Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Paul,
>
> The max height of a field is 32,767 pixels. This can be hard to quantify
> especially on mobile with the cornucopia of screen resolutions. I would
> imagine that this limit also applies to groups as well. I got bit on this
> when the app worked in the IDE but failed on some devices.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
>
>
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
> Behalf
> Of Paul Dupuis via use-livecode
> Sent: Monday, August 08, 2022 12:39 PM
> To: use-livecode@lists.runrev.com
> Cc: Paul Dupuis
> Subject: Re: Datagrid internal error
>
> On 8/8/2022 12:26 PM, Paul Dupuis via use-livecode wrote:
> > A customer encountered the following execution error (below) in our
> > app (built on Livecode 9.6.7, MacOS 12.5). This error is occurring in
> > the scrips for the Datagrid itself, rather than our code. At the end,
> > it is one of our handler, "populateMe", where line 139 is where the
> > error starts.
> > Line 139 set the dgProp["columns"] of grp "rwMatrixObj_DataGrid" to
> > tColumnNames
> >
>
> For example, some information from the customer suggest they are working
> with a VERY large dataset, so the length of the list in TColumnNames could
> be quit long - perhaps hundreds of lines. Is there a practical limit on the
> number of columns a Datagrid can be set to?
>
>
> ___
> 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
>
___
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: sqlYoga queries

2022-07-26 Thread Trevor DeVore via use-livecode
On Tue, Jul 26, 2022 at 10:08 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> sqlYoga can define table objects and relations in a database object.
> Heretofore I have not availed myself of this, being content to only work
> with query objects and record objects. Now as I am trying to optimize this
> new socket agent I wrote, I am wondering if a single query for all the data
> for a given customer/site/device would be more time efficient than multiple
> queries for each table. So the question is, if I were to use table and
> relations, could I craft a statement so that it perfoms a single query?
>

Hi Bob,

So table/relationship objects in SQL Yoga aren't required here. You can set
the `related table joins` (or just `joins`) property of a SQL Query Object.
See docs:
https://github.com/trevordevore/sql-yoga/wiki/SQL-Yoga-API#sqlquery_set

Per the docs, if you have table and relationship objects defined you can
use shorthand to set the property. You can just use the longhand approach
to run some tests and see if your code runs faster with a single query that
returns data from multiple tables vs multiple queries that query each table
individually.

-- 
Trevor DeVore
ScreenSteps
___
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


Automating LiveCode builds with Github Actions?

2022-07-26 Thread Trevor DeVore via use-livecode
Hello,

I would like to automate the following sequential steps using Github
Actions and I'm wondering if anyone has experience automating LiveCode with
Github Actions that they could share.

1. Open a stack in LiveCode and send a message to it. This would be for
building a Levure application.
2. Build an MSI file using Wix
3. Build an exe installer with Inno Setup.

The end result would be the ability to create MSI and exe installers from a
LIveCode application from a central location (Github) either manually or as
part of another workflow.

-- 
Trevor DeVore
ScreenSteps
___
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: Monterey + Dark Mode + LC 9.6.6

2022-07-25 Thread Trevor DeVore via use-livecode
Thanks for posting this Marty. I just needed to add that to my app :-)

-- 
Trevor DeVore
ScreenSteps

On Mon, Mar 7, 2022 at 7:10 PM Marty Knapp via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I think I found the issue. I use Levure to build my apps (great framework
> - you should try it!) and it uses a a customized plist file. I compared
> that to a plist file from a normally complied app and notice it has has
> parameter that is needed:
>
> NSRequiresAquaSystemAppearance
> 
>
> ---
> Marty Knapp
>
> > On Mar 7, 2022, at 4:05 PM, Marty Knapp 
> wrote:
> >
> > I just had a customer send a screen shot of my app (built with LC 9.6.6)
> running on Mac Monterey in dark mode and buttons and fields are all messed
> up. I don’t use dark mode and so tried it on my Mac and see the issue. I
> then tried an app built with a previous version of LC (9.6.1 I believe) and
> it looks fine. Anybody else seeing this?
> > ---
> > Marty Knapp
>
>
> ___
> 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: Building Windows standalones on Mac with LC 9.6.4 or later - apps not launching?

2021-09-24 Thread Trevor DeVore via use-livecode
On Fri, Sep 24, 2021 at 6:40 AM Ben Rubinstein via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Has anyone else encountered an issue building Windows standalones from LC
> 9.6.4 or 9.6.5 on Mac?
>
> …
>
> Before I report this in the LQCC and make myself look stupid - has anyone
> else
> built a Windows standalone from Mac on LC 9.6.4 or later, and did it work?


I have successfully built Windows executables on macOS three times with
9.6.4. The only issue I experienced was with tsNet business. I have a
specific version that is included when I package my app. The business
version pre-9.6.4 would not launch under 9.6.4. Updating the copy I
distribute with the version from 9.6.4 fixed the problem.

-- 
Trevor DeVore
ScreenSteps

>
___
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: Sorting text is *VERY* slow in LC9 on Windows (Re: Accumulating text is *VERY* slow in LC9 on Windows)

2021-09-10 Thread Trevor DeVore via use-livecode
On Fri, Sep 10, 2021 at 8:15 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 2021-09-10 14:06, Mark Waddingham via use-livecode wrote:
> > The windows heap is much more prudent than UNIXy counterparts it would
> > seem - where UNIX heaps will happily leave plenty of free space (which
> > the heaps know about and thus can re-use), Windows appears to avoid
> > that like the plague (which I'm sure is the case for lots of
> > historical reasons and backwards compatibility). [ To give a very
> > rough analogy, the map of used space in a heap on windows is like a
> > block of cheddar; whereas on UNIXy systems it will be like a block of
> > edam ].
>
> I of course meant 'Swiss', not 'Edam'!


Thanks for the clarification. I feel like I have a decent understanding of
cheeses, but I couldn’t figure out how cheddar and edam were different in
this analogy :-)

-- 
Trevor DeVore
ScreenSteps

>
___
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: [ANN] Release 9.6.3 RC-2

2021-07-23 Thread Trevor DeVore via use-livecode
On Fri, Jul 23, 2021 at 8:23 AM panagiotis merakos via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>   - Fix some images rendering as black in recent macOS versions


I can confirm that this issue is fixed on macOS Big Sur. Thanks!

-- 
Trevor DeVore
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: Implementing UNDO

2021-05-22 Thread Trevor DeVore via use-livecode
On Fri, May 21, 2021 at 3:11 PM Mike Kerner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> fyi, for posterity, here is the link to the wiki for levure's undo manager
> helper
> https://github.com/trevordevore/levure/wiki/helper-undo_manager


Here is a link to the code:

https://github.com/trevordevore/levure/tree/develop/framework/helpers/undo_manager

This should be easy enough to add to any app. I just checked the code and
there are no calls to any functions or commands in the Levure framework
itself. If you look at the helper.yml file you see this:

```
libraries:
  - filename: undoManager.livecodescript
frontscripts:
  - filename: field_edits_undo.livecodescript
autoload: false
```

What that means is that you should `start using stack
"undoManager.livecodescript"` when your app starts up and `put there is a
stack "field_edits_undo.livecodescript" into tStackIsNoInMemory`. (Note
that it is left as an exercise to the reader to determine the full path to
those stacks when being used in your app.) The
`field_edits_undo.livecodescript` stack just needs to be in memory so that
`undoManager.livecodescript` can insert it into the front whenever the user
is editing text in a field.

-- 
Trevor DeVore
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: Changes to revsecurity.dylib in LC 9.6.2?

2021-04-21 Thread Trevor DeVore via use-livecode
On Wed, Apr 21, 2021 at 1:19 PM panagiotis merakos via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Also, I am not entirely sure but I think LC 9.6.2 rc-1 and above was built
> with xcode 12.x, whereas 9.6.1 was built with Xcode 11.x. However, in both
> cases LC was built against the macosx10.9 sdk.
>
> Btw, the error msg and what you see looks similar to this report about
> revzip https://quality.livecode.com/show_bug.cgi?id=23176, that's why I
> suggested using entitlements when signing.


Panos,

Adding the `com.apple.security.cs.disable-library-validation` entitlement
solved the problem. Thanks!

It does make me wonder why it is needed, however. I would prefer not to
disable a check if possible. Regardless, I'm happy to have the app running
again.

-- 
Trevor DeVore
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


Changes to revsecurity.dylib in LC 9.6.2?

2021-04-21 Thread Trevor DeVore via use-livecode
This is a question for the LIveCode engineers. Did anything change with how
revsecurity.dylib is built for LC 9.6.2 compared to previous versions of LC?

I just built my application using LC 9.6.2 RC-5 in order to test. I'm
packaging the app with Levure, which uses the Standalone Builder. The app
works just fine when built with LC 9.6.1 RC 1 and it works in the LC 9.6.2
RC-5 IDE. The app also works when run on Windows. But when I run the
application on macOS encryption calls fails with the error "ssl library not
found".

Looking at the Console logs on macOS I see this error

default 12:49:42.154433-0500 kernel
/Users/xyz/path-to-app/Contents/MacOS/revsecurity.dylib: Possible race
detected. Rejecting.

A search for "Possible race detected. Rejecting" lead me to this thread
where an Apple engineer asked if the file that was loading is "built
against a modern macOS SDK (10.9 or later)?" (there is no answer yet).

https://developer.apple.com/forums/thread/677250

I'm going to do some further testing where I swap out the old
revsecurity.dylib and also try running the app prior to signing and
notarization. I'll provide an update once I am able to run those tests.

-- 
Trevor DeVore
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: We don't need a Player (was Re: New(?) Idea for Standalones)

2021-03-29 Thread Trevor DeVore via use-livecode
On Mon, Mar 29, 2021 at 4:35 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:


> I think we're all on the same page here.
>

:thumbs_up

-- 
Trevor DeVore
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: We don't need a Player (was Re: New(?) Idea for Standalones)

2021-03-29 Thread Trevor DeVore via use-livecode
On Mon, Mar 29, 2021 at 3:56 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> Here's the bottom of the post you were replying to:
>
>   One suitable solution in the box is all that's needed,
>   with the option for folks to turn it off if they prefer
>   using any other of the infinite variety of all possible
>   solutions.
>
>
> So yeah, I don't much mind whether we call them "hooks" or "options" or
> even "doilies" as long as it supports the core need right out of the
> box, without penalizing deeply-experienced professionals with specific
> tool preferences.
>

We agree that LiveCode should include a sensible baseline for building a
standalone. We also agree that they shouldn't try to write solutions for
all possible ways that someone may need to distribute a standalone. My 2
cents is that LiveCode should provide a way for 3rd parties to expand on
what happens when a standalone is being built. This is more than just
turning off an option. Turning off an option would introduce an absence of
behavior. I'm suggesting the addition of behavior that can occur during key
points of the standalone building process.

Perhaps all use cases can adequately be handled with the messages that are
already sent once when a standalone builder finishes (e.g. savingStandalone
and standaloneSaved).

But, perhaps the standalone building process would be better served with
additional, more granular callbacks, and maybe those callbacks are sent to
a target other than the stack being saved. That is what I would like to be
considered when modernizing the Standalone Builder.

-- 
Trevor DeVore
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: We don't need a Player (was Re: New(?) Idea for Standalones)

2021-03-29 Thread Trevor DeVore via use-livecode
On Mon, Mar 29, 2021 at 1:24 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor DeVore wrote:
>
>  > On Mon, Mar 29, 2021 at 12:31 PM Richard Gaskin wrote:
>  >> Add-ons to the product experience can be a useful temporary
>  >> workaround for long-time users, but if we step back and look
>  >> at the gestalt of the user experience they're not a true solution.
>  >>
>  >
>  > Do you think that LiveCode should have built in support for all of
>  > the various installers such as DropDMG, InnoSetup, WIX, etc.?
>
> "All" is the biggest possible number, potentially infinite.  So
> logically, of course the only answer is "no".
>

And that is why I like hooks into the standalone building process :-)

Provide the baseline solution but make it extensible so that developers who
need more can integrate whatever they need into building a standalone. The
less manual steps the better.

-- 
Trevor DeVore
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: We don't need a Player (was Re: New(?) Idea for Standalones)

2021-03-29 Thread Trevor DeVore via use-livecode
On Mon, Mar 29, 2021 at 12:31 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor DeVore wrote:
>
>  > On Mon, Mar 29, 2021 at 10:57 AM Richard Gaskin wrote:
>  >
>  >> TL/DR:
>  >>
>  >> We don't need a generic player.
>  >>
>  >> What we need is an updated Standalone Builder, to provide
>  >> more complete tooling and better guidance for building a
>  >> modern standalone.
>  >
>  >
>  > An easy way to extend the standalone building process with plugins is
>  > a necessity IMO as well.
>
> Add-ons to the product experience can be a useful temporary workaround
> for long-time users, but if we step back and look at the gestalt of the
> user experience they're not a true solution.
>

Do you think that LiveCode should have built in support for all of the
various installers such as DropDMG, InnoSetup, WIX, etc.? You either have
to support all of them or provide a hook so the developer can extend the
process. Either that or require the developer to create their own
additional workflow for processing the standalone after the fact.

-- 
Trevor DeVore
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: We don't need a Player (was Re: New(?) Idea for Standalones)

2021-03-29 Thread Trevor DeVore via use-livecode
On Mon, Mar 29, 2021 at 10:57 AM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> TL/DR:
>
> We don't need a generic player.
>
> What we need is an updated Standalone Builder, to provide more complete
> tooling and better guidance for building a modern standalone.
>

An easy way to extend the standalone building process with plugins is a
necessity IMO as well. For example, when packaging an app with Levure you
can add in Helpers to further customize the output generated when packaging
an app for distribution. In addition to handling signing, notarizing, and
stapling, one can generate a DMG using DropDMG, create an InnoSetup
installer script, creat a WIX installer script (creates a Windows installer
file that IT departments love), etc.

LiveCode doesn't need to build support for all of these in the SB, but it
should provide hooks so that plugins can further customize the process.

-- 
Trevor DeVore
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: Codesigning & notarizing

2021-02-05 Thread Trevor DeVore via use-livecode
On Fri, Feb 5, 2021 at 2:25 PM Marty Knapp via use-livecode <
use-livecode@lists.runrev.com> wrote:

> After much hair pulling and some help from Matthias I seem to have this
> solved. It appears that starting with LC 9.6.2 “entitlements” are needed
> even for web deployment (at least in the case of including revzip). The
> really weird part of this was if I swapped in the revzip bundle from 9.6.1
> after building the standalone then entitlements were not needed.
>
> So for anyone else who runs into this, you can use the same entitlements
> that Livecode uses (in an entitlements.plist file):
>

Thanks for sharing Marty. I wonder if this is why I was having SSL issues
with the standalone I built with 9.6.2? I'll play around with the
entitlements and see if that fixes it.

-- 
Trevor DeVore
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: Smooth scrolling

2021-02-05 Thread Trevor DeVore via use-livecode
On Fri, Feb 5, 2021 at 4:10 AM Niggemann, Bernd via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thank you Trevor for making this available. After testing your library i
> realize what an improvement it is.
> And I agree that "ideally any engine improvents would tap into the scroll
> wheel values provided by the OS"
>
> I don't see any difference regarding lineSize. Maybe
> "ObjC_NSEventHasPreciseScrollingDeltas" is true.
> Anyway in the comments of the LCB file you mention "row height"
> Do you mean "effectiv lineSize" (synonym of borderSize) or "effective
> textHeight"?
>

Hi Bernd,

Glad you like it. I originally wrote the extension for use with the
DataView (a more modern DataGrid) which has a "row" concept rather than a
"line" concept. I hadn't applied it to fields before putting together the
test yesterday. You are correct, if should be `textHeight`, not `lineSize`,
in the script.


> I added hScroll to your script (again this is Mac only and needs Trevor's
> library installed)
>
> ---
> on rawKeyDown pKey
>-- if the optionKey is down then pass rawKeyDown -- just to test
> scrolling of LC and library
>if pKey = "65308" or pKey = "65309" then
>   set the vscroll of me to the vscroll of me \
>- item 2 of macCurrentEventScrollValues(the effective linesize of
> me)
>else if pKey is in "65310,65311" and the hScrollbar of me then
>   set the hscroll of me to the hscroll of me  \
>   - item 1 of macCurrentEventScrollValues(the effective linesize of me)
>else
>   pass rawKeyDown
>end if
> end rawKeyDown
> 
>

Nice addition!

-- 
Trevor DeVore
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: Smooth scrolling

2021-02-04 Thread Trevor DeVore via use-livecode
On Tue, Feb 2, 2021 at 4:25 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> JeeJeeStudio wrote:
>
>  > Panos wrote:
>  >> This bug report contains a workaround for smooth scrolling - hope it
>  >> helps.
>  >> https://quality.livecode.com/show_bug.cgi?id=19759
>  >
>  >
>  > Maybe it's me but i don't see any difference in scrolling between the
>  > left and right on win10
>
> The original description of the problem here lacks specificity. It's not
> just any scrolling that is affected, but scrolling that happens in
> response to a scroll wheel or trackpad gestures.
>
> The script Panos posted in the bug report has two gradations of scroll
> increment, based on the interval between keydown messages corresponding
> to the scroll wheel/trackpad gesture.
>

I came across this thread and thought I would add an additional comment.
The scrolling can be improved further by using the scroll event values
provided by the operating system.

On macOS it is simple enough to get the true scroll values from the scroll
event using NSEvent.scrollingDeltaX and NSEvent.scrollingDeltaY. It is
possible to get those values using LCB as demonstrated in the
mac_scroll_wheel.lcb extension that is included with the DataView control
I've made available. Here is a link to the source code:

https://github.com/trevordevore/levurehelper-dataview/blob/develop/mac_scroll_wheel.lcb

Anyone who is interested and running macOS can download the compiled
version of the extension and test it out in the sample stack.

1) Visit the following link and click the "Download" button

https://github.com/trevordevore/levurehelper-dataview/blob/develop/mac_scroll_wheel.lcm

2) Then run this in the Message Box and select the .lcm file to load it:

answer file "Select Extension";load extension from file it;put the result

3) Add this script to any field you want to test with:

on rawKeyDown pKey

  if pKey = "65308" or pKey = "65309" then
set the vscroll of me to the vscroll of me - item 2 of
macCurrentEventScrollValues(the effective linesize of me)
  else
pass rawKeyDown
  end if

end rawKeyDown

On my computer I see the best results in the test stack from the bug report
using this method. Ideally any engine improvements would tap into the
scroll wheel values provided by the OS.

-- 
Trevor DeVore
ScreenSteps
___
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: clipboardData on Mobile?

2021-01-28 Thread Trevor DeVore via use-livecode
This should be possible using LCB. Years ago I posted code for an external
that copied to clipboard on iOS. I would guess that the APIs would be
straightforward to wrap in LCB for someone motivated enough to do it. Here
is the project:

https://github.com/trevordevore/iosclipboard

I don’t know about Android, but I believe there is a fair amount of Android
LCB code in the livecode GitHub repo that could used for guidance.

--
Trevor DeVore
ScreenSteps


On Thu, Jan 28, 2021 at 3:03 AM matthias rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> > But i am afraid using a LC to copy/paste to/from Clipboard on mobile is
> currently not possible.
>
>
> was meanto be
>
> But i am afraid using a LC script to copy/paste to/from clipboard on
> mobile is currently not possible.
>
>
>
>
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>
> > Am 28.01.2021 um 09:32 schrieb matthias rebbe via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > Hi Dan,
> >
> > The ClipboardData property is only supported on desktop operating
> systems.
> >
> > If using native fields, then you could let the mobile os copy/paste the
> clipboard data.
> >
> > But i am afraid using a LC to copy/paste to/from Clipboard on mobile is
> currently not possible.
> >
> >
> > -
> > Matthias Rebbe
> > Life Is Too Short For Boring Code
> >
> >> Am 28.01.2021 um 00:56 schrieb Dan Friedman via use-livecode <
> use-livecode@lists.runrev.com>:
> >>
> >> Greetings!
> >>
> >> Is there a way to set the clipboardData a mobile device?  (iOS and
> Android).
> >>
> >> Client want's a "copy" button so they can paste the text outside of the
> app (in Notes, or a external document).
> >>
> >>
> >> -Dan
> >>
> >> ___
> >> 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
>
>
> ___
> 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: Livecode Builder - passing lcs string to C functions

2020-12-28 Thread Trevor DeVore via use-livecode
On Mon, Dec 28, 2020 at 7:02 AM Dan Brown via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi I'm stuck trying to find examples of passing lcs strings to a C function
> via pointer and it's driving me mad! I can retrieve char * pointers from C
> functions, convert to string and pass back to lcs but haven't come across
> any easy to grok examples of sending data to C. Any guidance would be
> appreciated


I've used MCStringConvertToBytes to convert strings to a value you can pass
in as const char*. I have a hunspell example you can reference.

Here is a link to the Hunspell_spell definition:

https://github.com/hunspell/hunspell/blob/8a2fdfe5a6bb1cbafc04b0c8486abcefd17ad903/src/hunspell/hunspell.h#L69

```
LIBHUNSPELL_DLL_EXPORTED int Hunspell_spell(Hunhandle* pHunspell, const
char*);
```

Here is a link to the LCB code that passes a UTF8 string to Hunspell_spell:

https://github.com/trevordevore/lc-hunspell/blob/master/hunspell.lcb#L150

Here is a link to the MCStringConvertToBytes definition in the LCB file:

https://github.com/trevordevore/lc-hunspell/blob/master/hunspell.lcb#L19

-- 
Trevor DeVore
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: Encrypting Stack Breaks Field References

2020-12-23 Thread Trevor DeVore via use-livecode
On Tue, Dec 22, 2020 at 6:23 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hmmm… Isn’t Levure almost completely based on script only stacks?


You can use binary or script only stacks with Levure. It doesn’t care one
way or the other.  It’s just reading in stack files you add to your app
folder.

-- 
Trevor DeVore
ScreenSteps

>
___
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: Encrypting Stack Breaks Field References

2020-12-22 Thread Trevor DeVore via use-livecode
On Tue, Dec 22, 2020 at 3:23 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> What he said. The promise of creating standalones and encrypted stacks
> containing code sounds promising, but there are caveats. It begs the
> question, how do we encrypt script only stacks or libraries? I don’t use
> encrypted stacks because my code is for internal use only, but if I ever
> went commercial, this would be something I would need.


It is possible to convert script only stacks to binary, encrypted stacks
and save them using the same file name. The Levure app packaging  scripts
will do this when you package up an app. So you get the benefit of script
only stacks during development and the protection of encrypted when you
distribute.

-- 
Trevor DeVore
ScreenSteps

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


Shoudl LiveCode be calling exit() when terminating a Cocoa app?

2020-08-28 Thread Trevor DeVore via use-livecode
Hi all,

This is probably a question for someone from the LC team who works on the
engine. If anyone else is familiar with how LC quits on macOS please chime
in though.

Scenario: I am running tests with the Sparkle.framework on macOS (which I
already use) with the goal of silently and automatically downloading
updates for an application that will be installed the next time the user
quits the application. You can see similar behavior in apps such as Slack.

Sparkle support: Sparkle supports this type of behavior if you set some
properties. It checks and downloads an update to the local cache and then
installs the update when the hosting app graceful terminates.

Problem: I have confirmed that Sparkle downloads the updates to the cache
but the update is never installed when I quit. I'm wondering if this is due
to the use of exit(t_exit_code) in -applicationWillTerminate in mac-core.mm.

Additional Info: While researching the problem I found an issue in the
Sparkle Github project which had some interesting information in it. The
author of the issue mentions that the app terminates by calling exit(0):
https://github.com/sparkle-project/Sparkle/issues/1047#issuecomment-298029934

The maintainer says that Sparkle only supports graceful termination via
Cocoa notification:
https://github.com/sparkle-project/Sparkle/issues/1047#issuecomment-298041354

So I started looking through the LiveCode source code to see how LiveCode
terminates an app when `quit` is called in LiveCode Script. If found
mac-core.mm which has the main run loop which calls `[NSApp terminate:
self];` when it is time to quit:

https://github.com/livecode/livecode/blob/develop/engine/src/mac-core.mm#L360

That looks right. But farther down in applicationWillTerminate I found a
call to `exit(t_exit_code)`;

https://github.com/livecode/livecode/blob/develop/engine/src/mac-core.mm#L416

I'm wondering if that call to exit() is what is causing problems as my
understanding is that exit() immediately causes an app to terminate.
Perhaps exit() should only be called if t_exit_code > 0?

-- 
Trevor DeVore
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: Linking to a LC desktop app with a URL

2020-05-21 Thread Trevor DeVore via use-livecode
On Thu, May 21, 2020 at 1:52 AM David Bovill via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Yes thanks Trevor. I must some time soon migrate to using Levure - is
> there an easy Start here introduction for a new project?
> On 21 May 2020, 07:10 +0100, Peter Bogdanoff via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > This is great! Thank you Trevor!
>

You're welcome guys.

David - the wiki has a section on "Creating an Application". Hopefully it
is easy enough.

https://github.com/trevordevore/levure/wiki

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: Linking to a LC desktop app with a URL

2020-05-20 Thread Trevor DeVore via use-livecode
On Wed, May 20, 2020 at 5:12 PM Peter Bogdanoff via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Has anyone worked on the idea of accessing a LiveCode application from a
> web browser, such as happens with Zoom? With a URL link to a zoom.us
> page, the webpage shows a dialog:
>
> “Do you want to allow this page to open ‘zoom.us’?”
>
> which then opens the local app zoom.us.
>
> My use for this would be for enabling a user using an online LMS (learning
> management system) to directly access a location in my application on their
> local machine.
>
> I see a few methods described online, but was wondering if anyone has
> experience with this.
>

ScreenSteps uses this technique for sending actions from our web app to our
desktop. Extensive testing has been done on macOS and Windows. The Levure
framework has the file_system helper which does most of the work for you
on Windows, macOS, and iOS so you can look at that code for guidance. You
can find the source code at the link below. I will link to specific code
examples below as well.

https://github.com/trevordevore/levure/tree/develop/framework/helpers/file_system

There are three parts that make up a working solution - registration,
processing requests, and triggering requests. Here is a description of
each. Hopefully I'm not missing anything. I coded this a long time in
Levure and haven't had to think about it much since.

1. Tell the operating system your app can handle a url protocol.

## Windows

You will need to modify the registry. Here is a link to the command that
updates the registry in the file_system helper:
https://github.com/trevordevore/levure/blob/develop/framework/helpers/file_system/file_system.livecodescript#L193

The command uses levureStandaloneFilename(), a framework function that
returns the full path to the standalone application. Just replace that with
a similar function so that you can add the full path to your app to the
registry.

This command can be called each time your application launches if you want
to make sure that the version the user just launched is the one the OS will
send a url request to.

## macOS and iOS

Add the URL protocol you want to add to your Info.plist file. It will look
something like this (taken from the ScreenSteps Info.plist file) :


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>


... OTHER STUFF
  

  CFBundleURLName
  ScreenSteps URL
  CFBundleURLSchemes
  
x-screensteps-app
screensteps
screensteps-4
  

  


2. Process URL requests sent by the OS to your app

## Windows
Process `relaunch` command, extract command line arguments looking for url.

`relaunch` is handled within main Levure script:
https://github.com/trevordevore/levure/blob/develop/framework/levure.livecodescript#L46

The file_system helper processes the parameters though:
https://github.com/trevordevore/levure/blob/develop/framework/levure.livecodescript#L46

## macOS
Process the appleEvent with pClass "GURL" AND pID "GURL".

https://github.com/trevordevore/levure/blob/develop/framework/helpers/file_system/file_system.livecodescript#L111

## iOS
Process `urlWakeUp`.

https://github.com/trevordevore/levure/blob/develop/framework/helpers/file_system/file_system.livecodescript#L65

3. Triggering requests

Triggering requests is as simple as using your custom protocol in an 
tag in your web page.

Click me

Hopefully this helps you implement the behavior in your own app.

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: HTML Platform

2020-05-05 Thread Trevor DeVore via use-livecode
On Tue, May 5, 2020 at 4:03 PM Pi Digital via use-livecode <
use-livecode@lists.runrev.com> wrote:

> ...
> Because LC HQ seems uninterested in further development of the HTML
> platform and recent eco issues my client is rethinking if this is the best
> way to go. As it stands it does seem high-risk that it becomes outright
> abandonware in terms of HTML deployment. I’m on tender hooks whether we
> will continue development given this lack of LC HQ interest.
>

 I don't use HTML deployment myself, but thought I would mention that there
has been some emscripten activity in GitHub lately. Looks like WebAssembly
(WASM) support is being added. You can see the commits here:

https://github.com/livecodeian/livecode/commits/feature-emscripten-llvm

And here is the specific commit with the README:

https://github.com/livecodeian/livecode/commit/11dd134996f441abbbc802dba64c760ec800a10e

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: DataView and DataView Tree Updates

2020-05-04 Thread Trevor DeVore via use-livecode
On Sat, May 2, 2020 at 12:42 PM Trevor DeVore 
wrote:

> I've updated the DataView and DataView Tree code in my GitHub repos with a
> script that will load all of the necessary files for developers who are not
> using the Levure framework. You will find updated instructions in the
> README, a link to the latest release, and a link to a demo project showing
> what they can do at the following links:
>

 FYI - After some further testing around building standalones for a
non-Levure app and using it on mobile, I made some changes to the
installation instructions. You will find new instructions on the GitHub
pages and new version available for download.

DataView
Repo: https://github.com/trevordevore/levurehelper-dataview
Downloads: https://github.com/trevordevore/levurehelper-dataview/releases

DataView Tree
Repo: https://github.com/trevordevore/levurehelper-dataview_tree
Downloads:
https://github.com/trevordevore/levurehelper-dataview_tree/releases

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: DataView and DataView Tree Updates

2020-05-03 Thread Trevor DeVore via use-livecode
On Sun, May 3, 2020 at 1:11 PM JeeJeeStudio via use-livecode <
use-livecode@lists.runrev.com> wrote:

> your dataview demo throws an error on line 313: it's missing an before
> or into or after:
>

I just downloaded the version 0.4.0 from the Releases page and don't get
any errors.

https://github.com/trevordevore/dataview_demo/releases

Can you provide some more details about what you tested? There was a
missing "into" int the dataview_dbcursor submdoule but that was fixed
before I posted the update. Here is the commit:

https://github.com/trevordevore/levurehelper-database_dbcursor/commit/59cba88e26c17dac819f7137054868b71dcf6617

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: Script Only Behaviors

2020-05-02 Thread Trevor DeVore via use-livecode
On Sat, May 2, 2020 at 2:14 PM Ali Lloyd via use-livecode <
use-livecode@lists.runrev.com> wrote:

> It's also mentioned in the scriptOnly property and in the script only stack
> entry in the glossary
>

I'm not sure how I missed that. I searched for "script only" in the
dictionary and no results came up. I must have been filtering by LiveCode
Builder.

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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


DataView and DataView Tree Updates

2020-05-02 Thread Trevor DeVore via use-livecode
Hi,

I've updated the DataView and DataView Tree code in my GitHub repos with a
script that will load all of the necessary files for developers who are not
using the Levure framework. You will find updated instructions in the
README, a link to the latest release, and a link to a demo project showing
what they can do at the following links:

https://github.com/trevordevore/levurehelper-dataview

https://github.com/trevordevore/levurehelper-dataview_tree

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: Script Only Behaviors

2020-05-02 Thread Trevor DeVore via use-livecode
On Sat, May 2, 2020 at 8:36 AM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 5/2/20 12:06 AM, Trevor DeVore via use-livecode wrote:
>
> > script "My script-only stack" with behavior "A Stack Name"
>
> Nice! I didn't know that behavior syntax existed. Is that documented
> somewhere?
>

The only place I could find it is in the 8.1 Release Notes:

https://downloads.livecode.com/livecode/8_1_10/LiveCodeNotes-8_1_10.pdf

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: Script Only Behaviors

2020-05-02 Thread Trevor DeVore via use-livecode
On Fri, May 1, 2020 at 7:51 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> I’m gonna say that script only stacks cannot have behaviors eh? Reason is,
> I’d like to move my nested data grid behavior to a script only stack, but
> it occurs to me this might break the datagrid, since it’s next level
> behavior is the old data grid behavior button (not sure why that’s still
> there) then the actual script only datagrid library.
>

Hi Bob,

In fact script-only stacks can have behaviors. There are two ways you can
assign the behavior:

1) Define the behavior within the script-only stack itself.

script "My script-only stack" with behavior "A Stack Name"

Just make sure that the stack being assigned as the behavior is loaded into
memory when you load the script-only stack.

2) After loading the script-only stack into memory set the behavior
property.

If you need to assign the behavior of the script-only stack to a button
then use method #2.

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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


Spell Checker

2020-04-29 Thread Trevor DeVore via use-livecode
Hi folks,

FYI I've published a Github repo with a spell checker. The code is code
I've been developing for a spell checker replacement in apps I develop for
macOS and Windows. It uses NSSpellChecker on macOS and Hunspell on Windows.
If some kind soul wants to compile a Hunspell 1.6.2 .so library for Linux
the it would support Linux as well (I don't develop for Linux).

The url where you can go to learn about it, download it, or contribute to
it <—-! is here:

https://github.com/trevordevore/spell_checker

Instructions for using it in your LiveCode app are at the bottom of the
page.

The latest release, along with the LCE files for installing some extensions
that are required, can be found on the Releases page:

https://github.com/trevordevore/spell_checker/releases

For those adding the spell checker to a Levure application no need to
install the extensions. The repo is in Helper format and you can add the
folder to the Helpers folder in your app. Just make sure you are using the
newly released version 0.9.4 of the Levure framework in your app which
allows Helpers to define where .dll, .so, .dylibs, and the like should be
packaged up when building a standalone. Release notes for each version can
be found here:

https://github.com/trevordevore/levure/releases

P.S. I've updated my signature with links to my Github repos that relate to
LiveCode and LiveCode Builder. All of my public projects are under the MIT
license so enjoy!

-- 
Trevor DeVore
ScreenSteps - https://www.screensteps.com
Levure App Framework for LiveCode - https://github.com/trevordevore/levure/
LiveCode Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos -
https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
___
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: Which git service suits a LiveCoder best?

2020-04-28 Thread Trevor DeVore via use-livecode
On Tue, Apr 28, 2020 at 8:50 AM Mike Kerner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I wouldn't say it's using levure as intended.
> trevor, in his videos, anyway, does not export every script to an SOS, only
> ones that are a certain length.  if you do it that way, then scriptTracker
> could be valuable.
> I choose to put every script in SOS's, so scriptTracker isn't particularly
> useful for me.


To clarify, my guide wasn’t really script length. It was scripts in buttons
that only called a handler in the group, card, or stack script (which would
be SOS). So something like this:

on mouseUp pBtnNum
  if pBtnNum is 1 then
uiDoSomething
  end if
end mouseUp

It seemed counter productive to have SOS stacks for every button.

After a couple of rounds of refactoring I’ve changed my approach. I only
use SublimeText to work on code and when searching for handlers the ones
stored as part of the stack wouldn’t show up. In the above example I now
leave the button script empty and move the mouseUp to the group the button
is in. The mouseUp in the group branches based on the target.

This approach allows me to do a search and replace in all code within
SublimeText if I need to. Since I organize the UI into groups of controls
with their own behavior scripts no single mouseUp handler becomes too
unwieldy. It isn’t like there is one script that is branching for every
possible button click on the card.

Regarding the question of whether or not you would want to use Script
Tracker with Levure - Levure doesn’t really care :-) Levure has excellent
support for workflows that use script-only stacks. If you choose to it can
encrypt all of them when packing up a standalone. But it doesn’t require it
at all. Levure will happily work with any sort of stack file you add.

For example, one could add their existing stacks to a Levure app and start
leveraging the available Helpers (spell check, notary, auto update,
installer builders, etc.) without extracting any scripts to script-only
stacks.

- -
Trevor DeVore
ScreenSteps

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


Testing spell checking with Hunspell Extension

2020-04-22 Thread Trevor DeVore via use-livecode
Hi Everyone,

I've been working on an LCB extension which wraps the Hunspell library.
This library is used for spell checking.

https://en.wikipedia.org/wiki/Hunspell

I have finished a first pass that works on my Windows 8 and 10
installations with LiveCode 9.6dp-4 32 and 64-bit. I would be interested in
having some other people test it out to see if it works for them. I'm
hoping that those with Windows versions of LiveCode that support LCB could
test it out and see if everything works in the test stack. The Github repo
is at the url below and there is a section titled "Testing" which explains
the steps.

https://github.com/trevordevore/lc-hunspell

The extension is available under an MIT license and it would be nice to
have some others look over the code, make some improvements, compile a
Linux .so, etc.

The repo includes a French dictionary for testing. There are lots of
dictionaries available for Hunspell, however. I've downloaded dictionaries
from https://extensions.openoffice.org before. I also came across this
github repo today which has a large list of 90 compatible dictionaries:

https://github.com/wooorm/dictionaries

-- 
Trevor DeVore
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: Which git service suits a LiveCoder best?

2020-04-22 Thread Trevor DeVore via use-livecode
On Wed, Apr 22, 2020 at 3:46 AM Andreas Bergendal via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> So, in short: How do I best get started with git when working with
> LiveCode on Mac, in small teams or alone, wishing minimal use of command
> line?
>
> Do I just let gravity pull me into the GitHub gas giant, or join a rebel
> moon? :)
>

Hi Andreas,

I use GutHub for my LiveCode projects but haven’t looked at other services.
I enjoy using it and they recently reduced pricing and made a team account
available for free which is great.

There aren’t any special tools for LiveCode on GitHub that I’m aware of. It
isn’t even recognized as a language by GitHub. At the moment I’m investing
how I might get automated builds working for my Levure apps using GitHub
and CircleCI. I’m in the very early stages of research and haven’t made any
real progress yet.

I love using Tower for my Git GUI. I’ve been very pleased with it.

-- 
Trevor DeVore
ScreenSteps
___
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: Go to card has become slow

2020-04-13 Thread Trevor DeVore via use-livecode
On Mon, Apr 13, 2020 at 7:48 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 2020-04-13 07:06, Trevor DeVore via use-livecode wrote:
> > Will this caching of the DPI setting affect accessing the styledtext
> > property in general on Windows or will it only affect calls to it
> > during
> > saves?
>
> I did a quick test:
>
>- 'the styledText of' is unaffected
>
>- 'the effective styledText if' is about 25% faster
>
> This was using the sample text on card 1 of Neville's test data stack -
> each fetched 1000 times.
>

Thanks for testing. I use `the effective styledText` in a few instances
where it can be called often so it will be nice to get a speed bump on
Windows.

-- 
Trevor DeVore
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: Go to card has become slow

2020-04-13 Thread Trevor DeVore via use-livecode
On Mon, Apr 13, 2020 at 12:58 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 2020-04-13 02:23, Neville Smythe via use-livecode wrote:
> > But no, it shaved only 1 second off a 7 second save for styled text
> > (elderly MacPro running Windows 10 VM) So your engine modifications
> > must be having a much wider effect, not just on reducing the 3 API
> > calls for styled as opposed to plain text ??
>
> Each paragraph has at least one style run - even if no styles are
> applied so this is a general thing.
>
> Most of the text in your generated test (data) stack was unstyled anyway
> (as it uses 'the text of' to replicate the data) so minimizing those API
> calls should affect all stacks with a reasonable amount of field data in
> them.


Hi Mark,

Will this caching of the DPI setting affect accessing the styledtext
property in general on Windows or will it only affect calls to it during
saves?

-- 
Trevor DeVore
ScreenSteps

>
___
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: Apps to fight COVID-19

2020-04-10 Thread Trevor DeVore via use-livecode
On Fri, Apr 10, 2020 at 5:07 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 4/10/20 11:56 AM, Mike Doub via use-livecode wrote:
> > Apple and Google adding contact tracking to their OSs
> >
> >
> https://www.nytimes.com/2020/04/10/business/stock-market-today-coronavirus.html#link-418ae121
>
>  From my limited understanding of this, Apple and Google are creating an
> API which will be part of the OS. And then it's up to developers to
> create apps and convince users to download them (Apple gets their 30%
> off the top, no?). So at best we have reporting from the set of users
> who have decided to opt in, download an app, and accept the app's
> permissions.


Here are some additional details. Seems like a good thing they are doing.

https://techcrunch.com/2020/04/10/apple-and-google-are-launching-a-joint-covid-19-tracing-tool/

-- 
Trevor DeVore
ScreenSteps
___
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: Umlauts (again) and arraytojson

2020-04-09 Thread Trevor DeVore via use-livecode
On Thu, Apr 9, 2020 at 8:06 AM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi friends,
>
> this just came up in the german LC forum, obviously "arraytojson"
> does not like UMLUATS in the keynames!?
>
> This:
> --
> on mouseUp
>  put "eins" into tArray["äns"]
>  put "zwei" into tArray["zwöi"]
>  put arraytojson(tArray)
> end mouseUp
> --
> gives -> {}
>
> Is this correct/desired behaviour?


Correct? Yes. The data and keys are not UTF-8 encoded.
Desired? No.

Try encoding the keys and data as UTF-8 before passing to arraytojson.
Arraytojson() uses the mergJSON external and requires UTF-8 data.

--
on mouseUp
 put textEncode("eins", "utf8") into tArray[textEncode("äns", "utf8")]
 put textEncode("zwei", "utf8") into tArray[textEncode("zwöi", "utf8")]
 put arraytojson(tArray)
end mouseUp
—

You can refer to the following report I filed on the current state of JSON
in LiveCode (which is not good). In my work I use both the JSON Library and
mergJSON as described in the report.

https://quality.livecode.com/show_bug.cgi?id=22478

-- 
Trevor DeVore
ScreenSteps

>
___
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: Who else doesn't want auto-select when opening a card?

2020-04-07 Thread Trevor DeVore via use-livecode
On Mon, Apr 6, 2020 at 1:39 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> This makes me crazy. I almost never want the first field selected when I
> go to a card,
> particularly on mobile. And god forbid the first field is a list field,
> where the first line is
> hilited whenever the stack resumes focus, even if the hilitedline was 0.


Agreed. Focusing on a field if you need to is simple and can be achieved
using one line of code. Plus, by coding it you don’t have to worry about
the wrong field obtaining focus if you change the layering order of
controls later on.

- -
Trevor DeVore
ScreenSteps

>
___
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: specialFolderPath, Microsoft Window, and 64 bits

2020-03-31 Thread Trevor DeVore via use-livecode
On Tue, Mar 31, 2020 at 11:52 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> Okay, I was running LC960dp3 (32 bit) so I downloaded LC960dp2 (64 bit)
> [I chose dp2 only because I didn't want 32 and 64 bits of the same
> version installed in case of some unknown conflict). Reran my paths test
> and your DO get different results!
>
> Most interestingly:
> specialFolderPath(38) = C:/Program Files is the 64 bot applications folder
> and
> specialFolderPath(42) = C:/Program Files (x86) is teh 32 bit
> applications folder
>
> So, if I am using LC to build a Windows 64 bit standalone that 64 bit
> standalone can get BOTH the 64 bit Programs folder path AND the 32 bit
> Program folders path to check for the presence of a 3rd party
> application that could be installed as either 32 or 64 bit.
>
> HOWEVER, if I have built a 32-Bit LC standalone, that can not get the
> path for the 64 bit Programs folder. It can ONLY get the path for the 32
> bit Programs folder
>
> A little disappointing. My use case remains. My app (currently 32 bit)
> needs to check if a 3rd party app is installed. That 3rd party app could
> be have either a 32 bit version or a 64 bit version installed. I would
> like to use some sort of "specialFolderPath" precisely so it a user has
> a non standard installation I get the correct paths.
>

Paul,

I had a similar situation recently where I needed to get some DPI
information about the monitors that wasn't available through my LC main
application. I ended up writing a simple command line tool in Visual Studio
that used the Windows APIs and returned the proper information. I included
that exe with my app and called it from within LC. In your case you would
create a 64-bit command line app and I'm guessing you could find sample
code for such a common API call.

-- 
Trevor DeVore
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: Using Shift + Cmd + 1 as a menu short in LiveCode

2020-03-30 Thread Trevor DeVore via use-livecode
Guys,

Please don't hijack the thread.

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com

On Mon, Mar 30, 2020 at 12:07 PM Richmond via use-livecode <
use-livecode@lists.runrev.com> wrote:

> This is worth a look:
>
> https://support.apple.com/en-us/HT201236
>
> On 30.03.20 19:54, doc hawk via use-livecode wrote:
> > On Mar 30, 2020, at 8:02 AM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >> Cmd-E will eject a mounted removable disk. I've never heard of
> Cmd-Shift-1.
> > Newbie :)
> >
> > It seems to have disappeared some time ago.
> >
> > I know that I used it some years ago on a CD, to my surprise.
> >
> > -3 and -4 are still live, but the whole set were very, very low level
> way back when.
> >
> > I bring it up because even thought apparently not implemented any more,
> there might still be some system intercept that catches it under some OSX
> variants.
> >
> >
> > ___
> > 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
>
___
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: Using Shift + Cmd + 1 as a menu short in LiveCode

2020-03-25 Thread Trevor DeVore via use-livecode
On Wed, Mar 25, 2020 at 3:58 PM Curry Kenworthy via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> This was reported by me and confirmed by LC last year:
>
> https://quality.livecode.com/show_bug.cgi?id=22107
>
> (Shift-Tab is the most problematic example, since it doesn't have a
> convenient shifted char. Menu defs seem glitchy, so we may need to file
> additional reports but hoping this Shift bug gets nailed soon.
> Introduced in LC7 - one of the many still with us over the years.)
>

Thanks for pointing me to that Curry. I've added myself to the CC list as
the two may very well be related.

-- 
Trevor DeVore
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: Using Shift + Cmd + 1 as a menu short in LiveCode

2020-03-25 Thread Trevor DeVore via use-livecode
On Wed, Mar 25, 2020 at 1:28 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Shift-1 = !
>

Right. But using ⌘ + Shift + 1 looks much better in the menu to me than ⌘
!. With ⌘ ! the user has to piece together that they need to add SHIFT to
create the ! character. ⌘ + Shift + 1 tells the user every key to press
just by looking at it.

-- 
Trevor DeVore
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


Using Shift + Cmd + 1 as a menu short in LiveCode

2020-03-25 Thread Trevor DeVore via use-livecode
Hi all,

I tried assigning Shift + Cmd + 1 to a menu shortcut in LiveCode but
LiveCode insists on using Cmd + 1 instead. I would like to insist that it
use Shift + Cmd + 1, just as I entered it :-)

Anyone know how to trick LiveCode into using what I entered?

I know Shift + Cmd + 1 can be used as XCode uses this key combination for a
shortcut in the Windows menu. I'm currently testing on macOS 10.14.

Simple Recipe:
1) Create a new stack
2) Open the Menu Builder
3) Create a new menu bar
4) Select File > New and check the Cmd and Shift checkboxes then type 1
into the shortcut field.
5) Test the menu. It shows the following:
File
New ⌘ 1
Open   ⌘ 0
Close   ⌘ W

-- 
Trevor DeVore
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: Any electronic document formats offering interactivity?

2020-03-19 Thread Trevor DeVore via use-livecode
On Thu, Mar 19, 2020 at 5:49 AM David V Glasgow via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> I did briefly consider HTML, but wanted to deliver a single file as the
> output, and an image of the dashboard profile is essential.
>

You can embed images within the HTML itself using the "data:" URLs:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

-- 
Trevor DeVore
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: LC 9.6.0 DP2

2020-02-18 Thread Trevor DeVore via use-livecode
On Tue, Feb 18, 2020 at 11:07 AM Mark Talluto via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> Here is a fun sidenote. Windows 7 has also lost support from Microsoft as
> of Jan 14, 2020. Microsoft provides a program called Extended Security
> Updates.
>
> This program buys companies up to three years of support. It is my
> understanding that the program is expensive. The program is for big
> businesses and not available to individuals.
>
> So, if you are developing for organizations that rely on Windows 7, this
> may be useful for your next meeting with IT.
> https://support.microsoft.com/en-us/help/4527878/faq-about-extended-security-updates-for-windows-7
> <
> https://support.microsoft.com/en-us/help/4527878/faq-about-extended-security-updates-for-windows-7
> >
>

Thanks for sharing that Mark. I wasn't aware that Microsoft had this
program.

My company recently announced that we are dropping official support for
Windows 7 with our next desktop update. We won't stop it from working but
we will no longer test new features on it. We haven't had anybody write
back requesting that we continue to support it. As a reference, our
customer base is made up of small to medium businesses as well as larger
corporations.

-- 
Trevor DeVore
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: Nested numeric lists that include number of parent list item

2020-02-11 Thread Trevor DeVore via use-livecode
On Tue, Feb 11, 2020 at 11:03 PM Terry Judd via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Yeah, this isn't helpful either, but while we're on the shortcomings of
> ordered lists in Livecode if you render an alphabetically ordered list
> using htmlText then it is rendered as lowercase irrespective of whether you
> specify type='A' or type='a'. The only way to guarantee that it is right is
> to explicitly set the listStyle to 'upper latin' (or whatever).


That is good to know. I convert HTML from an outside source to a styledText
array which I then assign to a field. Hopefully that isn’t affected by the
same bug since the listStyle is part of the array. I’ll make sure and test
that particular case though.

-- 
Trevor DeVore
ScreenSteps

>
___
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: Nested numeric lists that include number of parent list item

2020-02-11 Thread Trevor DeVore via use-livecode
On Tue, Feb 11, 2020 at 7:11 PM Niggemann, Bernd via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I am not aware that listStyle decimal can show other then 1. No further
> sub numbering.
>
> However one could hack it. Although I know you are not particularly fond
> of those hacks...
>
> The code assumes that the listStyle of a field is set (any) will be "skip"
> afterwards and list depth is also set.
>

Thanks for the suggestion Bernd. I appreciate you taking the time. You are
right though, I'm not particularly fond of hacks in the field control when
the field is being used as a text editor (which is my use case).

Here is the reason why. When writing a text editor it doesn't take long for
the hacks to get out of hand and you end up with a control that becomes
hard to add features to and hard to perform maintenance on. In addition,
the field stops behaving or looking the way a user expects a text editor to
work. For example, if I were to add the hack for displaying nested numeric
lists I would need to add a hack for keeping track of other list styles the
user might select elsewhere in the field. I would also have to deal with
incorrect indentation for multi-line list items because the text would
appear flush with the list numbers. Then I would need to add a hack to
handle deletion of characters properly since the numbers are part of the
actual text rather than an ornament that is added by the engine. There is
this ripple effect which always makes me wish I hadn't implemented the hack
:-)

-- 
Trevor DeVore
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


Nested numeric lists that include number of parent list item

2020-02-11 Thread Trevor DeVore via use-livecode
Hi all,

I am working with nested lists in LiveCode using listStyle and listDepth.
When using a "numeric" listStyle I get this output in a field:

1. asdf ajsdf asf
   1. adsfasdfasdf
  1. asdfasdfasdf

I would like to get the following output but I'm not seeing a property that
enables it. Am I missing something or is not possible using listStyle and
listDepth?

1. asdf ajsdf asf
   1.1. adsfasdfasdf
  1.1.1. asdfasdfasdf

-- 
Trevor DeVore
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: [macOS] Notarization, hardened runtimes, LCB, and executables

2020-02-06 Thread Trevor DeVore via use-livecode
On Thu, Feb 6, 2020 at 3:22 PM panagiotis merakos via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Very useful post Trevor, thank you.
>
> Can you confirm that the notarized standalone does NOT open in Mac OSX
> 10.9-10.11?
>

I have a 10.10 VM. I just tested the app I notarized and it worked fine.

-- 
Trevor DeVore
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: [macOS] Notarization, hardened runtimes, LCB, and executables

2020-02-06 Thread Trevor DeVore via use-livecode
On Thu, Feb 6, 2020 at 12:12 PM David V Glasgow via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I have to say that this fills me with despair.  I try hard to  write
> serious, useful  programs, for fellow professionals,  but I am not a
> developer by trade or training.  I have a full time job, which subsidises
> my time using LC
>
> The beauty of LC (and Metacard before it)  has always been how amazingly
> easy it is to write something genuinely useful and share it with others,
> pretty much irrespective of platform.  I used to just share with colleagues
> via DropBox.
>
> Now I look at an app I have developed and realise I have neither the time
> or technical ability to navigate through certification and notarization.
>
> Is this the beginning of the end for enthusiast developers?
>

I don't see a reason why these new complexities (at least most) can't be
hidden from most users. LC already hides all sorts of things from us that
we don't want to know anything about. Code signing and entitlements aren't
tricky problems to address, at least once you understand the problem. But
it will take time to do the research, design a UI, hook up the UI, and
write the underlying code.

-- 
Trevor DeVore
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: [macOS] Notarization, hardened runtimes, LCB, and executables

2020-02-06 Thread Trevor DeVore via use-livecode
On Thu, Feb 6, 2020 at 10:23 AM Trevor DeVore 
wrote:

>
> After packaging up the app I did a quick test to make sure the new feature
> worked on my machine. It didn't. The error message was about some code
> trying to execute that wasn't signed and some note about library validation
> or something or other (I didn't write it down).
>

Actually, I did capture the error:

[13283] Error loading Python lib
'/var/folders/px/g8hg_x_10697wwmdb9t3thd4gn/T/_MEIT0IjWA/Python':
dlopen:
dlopen(/var/folders/px/g8hg_x_10697wwmdb9t3thd4gn/T/_MEIT0IjWA/Python,
10): no suitable image found.  Did find:
/var/folders/px/g8hg_x_10697wwmdb9t3thd4gn/T/_MEIT0IjWA/Python: code
signature in
(/var/folders/px/g8hg_x_10697wwmdb9t3thd4gn/T/_MEIT0IjWA/Python) not
valid for use in process using Library Validation: mapped file has no
cdhash, completely unsigned? Code has to be at least ad-hoc signed.

-- 
Trevor DeVore
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


[macOS] Notarization, hardened runtimes, LCB, and executables

2020-02-06 Thread Trevor DeVore via use-livecode
Hey list,

I just spent a good portion of the last few days troubleshooting some
notarization errors I started receiving. I'm going to document what I did
so that someone else out there might benefit.

# The Original Problem

I have been notarizing my application for a while now without any issues.
This week an error message started coming back from Apple: "The executable
does not have the hardened runtime enabled.". (I found the error my looking
at the log file that Levure creates when packaging an application. It
contains the responses from the Apple notarization service which in turn
contain a url pointing to a detailed report of why an app fails
notarization.) A search led me to the following web page which tells me to
pass the `--options=runtime` to the `codesign` command line call to fix
this issue.

https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/resolving_common_notarization_issues?language=objc

Easy enough. I updated the Levure packager script (see links below) that
packages up applications so that it will automatically sign the app bundle
and the files inside using this option as part of the packaging process.

I ran into some problems when trying to sign the Sparkle.framework that
ships with my app. It has an Autoupdate.app app inside of the
`./Content/Resources` folder which in turn contains a `filop` executable
that wasn't being signed. I had to spend some time making additional
improvements to the Levure packager script so that it would dig down into
the necessary folders looking for files that need signing.

After making the necessary changes so that all files were properly signed
application was successfully notarized by Apple. Phew!

# The Problem Caused By The Solution To The Problem

Unfortunately the solution of hardening the runtime uncovered yet another
problem. My application started throwing an error when trying to load some
LCB code. The LiveCode engine was unable to bind to some Foreign Function
Interface definitions in one of my LCB files. The problematic binding is
defined as follows:

private foreign handler C_CurrentKbdLayoutInputSource() returns ObjcId
binds to "c:Carbon.framework>TISCopyCurrentKeyboardLayoutInputSource"

# Entitlements

Since none of my code had changed I looked in the Console application to
see if there were any error messages. I saw a message in the console about
my app needing the `com.apple.security.automation.apple-events` permission
so I chased that red herring for a while. As part of my research I came
across entitlements. Entitlements are a way for you to tell macOS that your
app needs special permissions. I've used them before in the Mac App Store
but not for apps used outside the store.

The following web page lists the entitlements that are available for a
macOS app:

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation?language=objc

As I scanned through the list a couple of the options caught my eye. For
instance, `com.apple.security.cs.allow-dyld-environment-variables` sounds
like something that might apply to LCB.

My first test involved assigning a number of entitlements to my app to see
if it would launch. Sure enough it did. I then started removing
entitlements until I found the smallest list that would work. Here is the
final entitlement file that I came up with that allowed my LCB code to run
without causing an error or causing a spinning beach ball of doom:


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>


  com.apple.security.cs.allow-unsigned-executable-memory
  
  com.apple.security.cs.allow-dyld-environment-variables
  



The above XML goes in a file with the same name as my app with an
`.entitlements` extension. That file is added to the `./Contents/Resources`
folder of the app bundle and Levure then uses that file when signing the
app. Learn more:
https://github.com/trevordevore/levure/wiki/How-do-I-include-additional-files-and-folders-in-my-application-builds%3F#copy-files-into-the-contentsresources-folder-of-your-packaged-macos-application

This same entitlements file also fixed a problem I was seeing with the
browser widget in my app. It too would lock up.

# Mostly Smooth Sailing

With a hardened runtime and the proper entitlements in place my LiveCode
app was being notarized successfully AND launching. Good times! Feeling
confident I decided to merge in a branch I had been working on that
included an executable created using pyinstaller so I could send it off to
QA. That didn't go well.

After packaging up the app I did a quick test to make sure the new feature
worked on my machine. It didn't. The error message was about some code
trying to execute that wasn't signed and some note about library validation
or something or other (I didn't write it down). After some searches I found
some other people who experienced similar problems with executables built
with pyinstaller (and some other installers I believe). 

Re: Apple Mac menubar?

2020-01-22 Thread Trevor DeVore via use-livecode
On Wed, Jan 22, 2020 at 12:25 PM Pi Digital via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Trevor
>
> It’s so helpful to have these guides. What kind of things do you use nsSSB
> for? I totally see it’s benefits. It would be great to hear your personal
> uses as examples of usefulness.
>

My application has a screen capture component and a user can trigger screen
captures through the status bar menu, change some capture settings, and
open/close some windows/palettes in the application.

-- 
Trevor DeVore
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: Apple Mac menubar?

2020-01-21 Thread Trevor DeVore via use-livecode
On Tue, Jan 21, 2020 at 11:59 AM Håkan Liljegren via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I this is already created by our hero Trevor Devore. Take a look at his
> github page:
>
> github.com/trevordevore/lc-macos-toolset
>
> what you are looking for is the nssystem-status-bar.lcb
>

Thanks for the kind words Håkan. I hope that repo is helpful to people who
are exploring LCB.

Folks - If you have access to Mac Status Menu in LC 9.6 (I don't know if it
is available in Community or not) I would suggest using it. That is what i
use in my applications and it works great.

-- 
Trevor DeVore
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: YAML Libraries

2020-01-21 Thread Trevor DeVore via use-livecode
On Tue, Jan 21, 2020 at 11:06 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor, I'm curious what the significance is in using /** as the begin
> comment indicator? Is it something you use internally?


The comment syntax I use before a handler is the documentation syntax used
by LiveCode to create docs from scripts.

-- 
Trevor DeVore
ScreenSteps

>
___
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: YAML Libraries

2020-01-19 Thread Trevor DeVore via use-livecode
On Fri, Jan 17, 2020 at 2:19 PM Sannyasin Brahmanathaswami via use-livecode
 wrote:

> I found the handler
>
> ## Monte's YAMLToArray command
> constant kMultiLineModeNone = 0
> constant kMultiLineModeLiteral = 1
> constant kMultiLineModeFolded = 2
>
> command YAMLToArray pYaml
>
> [snip] in the levure initialization behavior.
>
> I think that's it. There is no "ArrayToYaml"  but that is not needed.
>

BR - I'm glad you were able to locate the handler you need in the source
code. Here is a handler I use for printing out arrays as YAML when I'm
debugging or logging. It most likely could use some improvements but works
well for what I do with it.

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com

/**
Summary: Prints an array using YAML.

Returns: YAML string
*/
function printArray pArray
  local tKeys, tKey, tYAML

  put the keys of pArray into tKeys
  sort tKeys numeric

  repeat for each line tKey in tKeys
put _outputKeyAsYAML(pArray, tKey, 1) & cr after tYAML
  end repeat
  delete the last char of tYAML

  return tYAML
end printArray


private function _outputKeyAsYAML pArrayA, pKey, pLevel
  local tIndent, tKey, tStr, i

  repeat with i = 1 to pLevel-1
put space & space after tIndent
  end repeat
  put tIndent after tStr
  put pKey & ": " after tStr

  if pArrayA[pKey] is an array then
put cr after tStr
repeat for each key tKey in pArrayA[pKey]
  put _outputKeyAsYAML(pArrayA[pKey], tKey, pLevel+1) & cr after tStr
end repeat
  else
if pArrayA[pKey] contains CR then
  put space & space after tIndent
  put "|+" & cr & tIndent after tStr
  replace CR with CR & tIndent in pArrayA[pKey]
end if

if pArrayA[pKey] contains "'" then
  replace "'" with "''" in pArrayA[pKey]
  put "'" & pArrayA[pKey] & "'" & cr after tStr
else
  put pArrayA[pKey] & cr after tStr
end if
  end if
  delete the last char of tStr

  return tStr
end _outputKeyAsYAML
___
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: encrypting script-only stacks

2020-01-14 Thread Trevor DeVore via use-livecode
On Tue, Jan 14, 2020 at 10:36 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 1/14/20 9:46 AM, Richard Gaskin via use-livecode wrote:
>
> > Beyond backup across versions (since that's widely available in most
> > cloud storage for even binary files), that Git features do you find most
> > valuable?
> >
>
> As in Trevor's description, the advantage of being able to create new
> branches for experimental work can't be overstated.
>
> Consider: you have a working project and want to try making some changes
> that may or may not work. And that may or may not stop existing things
> from working. Or maybe you just want to try some A-B testing and be able
> to create two different versions. Or create a new version and be able to
> do some performance benchmarking.
>
> All without messing with your existing product code.
>
> If it works you can merge the branch into the main code. If not then
> just dump the branch and you haven't lost anything except some time.
>
> I also use tagging in git to set release values, so that I can easily
> see what's changed from one release to the next.
>

I'll toss in an amen to both of these points (testing optimizations, etc.
and tagging releases). I use Tower as my Git GUI with Kaleidoscope for
diffs. I can easily see a diff of all files that have changed between two
releases because I tag the commit that was current at release time of each
version.

-- 
Trevor DeVore
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: encrypting script-only stacks

2020-01-14 Thread Trevor DeVore via use-livecode
On Tue, Jan 14, 2020 at 4:14 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks, Trevor.  That's a helpful outline.
>
> I haven't had a business case to support so many branches, but I can see
> where it might be useful down the road.
>
> Any opinions on Github vs Gitlab?
>

I've only used Github so I can't offer up a comparison. I've been happy
with Github for the most part and my company has been working with it for a
number of years.

-- 
Trevor DeVore
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: encrypting script-only stacks

2020-01-14 Thread Trevor DeVore via use-livecode
On Tue, Jan 14, 2020 at 2:35 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor DeVore wrote:
>
> > I use SoS extensively but I had never tried using the SB to encrypt them
> as
> > I use Levure. The Levure packaging library automatically encrypts script
> > only stacks for you during the packaging process. While Levure uses the
> SB
> > to create the standalone, encrypting the stacks is handled in the Levure
> > packaging library, not the SB.
>
> I'm assuming Levure does this by converting a copy of the SoS stack
> files to binary stack files, yes?
>

That is correct. The SoS is opened, the the scriptonly property of the
stack is set to false, and then it is saved using the same filename. This
is all done in a temporary directory so that the source file isn't modified
at all.

-- 
Trevor DeVore
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: encrypting script-only stacks

2020-01-14 Thread Trevor DeVore via use-livecode
On Tue, Jan 14, 2020 at 11:47 AM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> ...
>
> Help me motivate to move my Git transition forward sooner:
>
> Beyond backup across versions (since that's widely available in most
> cloud storage for even binary files), that Git features do you find most
> valuable?
>

Hi Richard -

One way I use Git is to develop multiple features in tandem without
affecting the version I distribute of my app that I distribute to
customers. I love how I can silo my own work on features as well as the
flexibility to see detailed history of changes throughout the life of my
application. I use the Git commit notes and the ease with which you can
review changes in those commits a number of times when trying to track down
at what point a bug was introduced.

Here is an example of how I silo work I'm doing right now. If you looked at
my Git repo earlier today you would see the following branches:

- master
- develop
- tkd-htmltidy
- tkd-remove-answer-types
- tkd-mammoth
- tkd-hires-annotations

`master` always has the release version of the code.

`develop` is code that has been developed, tested, and is ready to go into
the next release. I will create builds from this branch to send to
customers who want early access to a feature or bug fix.

All other branches are features that are being worked on but which are not
finished and require more testing. Some of those branches exist for an
afternoon. Some last for a month or more.

Today I merged in `tkd-htmltidy` and tkd-remove-answer-types` into
`develop` as they were finished and are ready to send to customers who need
early access. When I squashed and merged those branches in there were a
number of changes which had been made in the develop branch since I had
started `tkd-htmltidy`. Those changes were seamless blended together
without any problem, even though there were changes changes made in some of
the same files. In addition, because I squashed the merge, all of the
changes that went into the addition of HTML Tidy are seen as one commit in
my `develop` branch. I made dozens of commits during development but was
able to make one clean commit when I was all done and ready to merge the
changes with the main code branch. This makes for a clean history that is
easier to review later on.

I will continue to work on the tkd-hires-annotations and tkd-mammoth
branches as they aren't done yet and require more revisions. But once they
are ready I perform the same squash and merge. If I want an internal tester
or a customer to test those features out before they are ready I can do
that too. I can use the Git rebase feature to bring in all changes to
`develop` that have been made since I created a particular branch. That
means the tester is using the latest version of the app along with the new
feature I'm working on.

One last example. Let's say that a nasty bug turns up while I'm working on
`develop` and need to get a release out to customers right away. I can go
to master, create a new branch from that code, make the fix, and package up
a new installer. I can merge that fix into `develop` as well so that it
will be included in a future update.

I think the scenarios I describe above are my favorite reasons for using
Git as they make my daily development and management of the code easier.

-- 
Trevor DeVore
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: encrypting script-only stacks

2020-01-14 Thread Trevor DeVore via use-livecode
On Tue, Jan 14, 2020 at 1:13 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Exactly.  I was hoping the Standalone Builder would do that if you
> choose to include external SoS in the standalone.
>
> What I found instead is that it doesn't being them into the standalone
> stack file as substacks, nor even convert them to binary stack files in
> place.  It just refuses to allow a password to be set.
>
> For apps making rich use of SoS, it would seem tedious to do that
> conversion by hand, or to expect every developer to write the same pair
> of handlers to automate that before and after building the standalone.
>
> How do folks who use SoS frequently protect those SoS scripts?
>

I use SoS extensively but I had never tried using the SB to encrypt them as
I use Levure. The Levure packaging library automatically encrypts script
only stacks for you during the packaging process. While Levure uses the SB
to create the standalone, encrypting the stacks is handled in the Levure
packaging library, not the SB.

I agree that the SB should handle this for you though.

-- 
Trevor DeVore
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: Missing keys in datagrid?

2019-12-18 Thread Trevor DeVore via use-livecode
On Wed, Dec 18, 2019 at 6:40 AM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Trevor,
>
> thanks for chiming in!
>
> > Am 18.12.2019 um 13:28 schrieb Trevor DeVore via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > On Wed, Dec 18, 2019 at 2:38 AM Klaus major-k via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> > ...
> > So my guess is that you are populating the DataGrid with data that only
> has
> > 10 columns. Could that be the case?
>
> No, I really provide an array with all my columns in it, empty or not.
>

Given how PrintKeys works it would appear that the keys are being removed
from the internal sDataArray array. You can inspect the array yourself by
putting the dgData of the DataGrid into a variable and setting a
breakpoint. Or assign the dgData to a tree widget as Richard suggested.

-- 
Trevor DeVore
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: Missing keys in datagrid?

2019-12-18 Thread Trevor DeVore via use-livecode
On Wed, Dec 18, 2019 at 2:38 AM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Bob,
>
> > Am 18.12.2019 um 01:13 schrieb Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > If I recall a long time ago speaking with Trevor, printkeys() does not
> necessarily return ALL keys.
>
> AHA!
> OK, that explains something, but not all.
>
> Empty or not, this SHOULD list all keys, but doesn't?
>

One nice aspect of LiveCode is that you can inspect all of the code to see
what is going on behind the scenes. For PrintKeys you can get to the script
that has it in one of two ways:

edit script of behavior of behavior of selobj()
edit script of stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior"

This is the PrintKeys handler:

```
command PrintKeys pArray
if pArray is not an array then put sDataArray into pArray
put _PrintKeys(pArray)
end PrintKeys
```

And here is the _PrintKeys() function:

```
private function _PrintKeys @pArray, pDimension
   if pDimension is empty then put 0 into pDimension

   local theKeys, theText, theTempArray
   put the keys of pArray into theKeys
   sort theKeys numeric

   repeat for each line theKey in theKeys
  if pArray[theKey] is an array then
 put _printCharXTimes(space, pDimension * 5) & theKey & cr after
theText
 put pArray[theKey] into theTempArray
 put _PrintKeys(theTempArray, pDimension + 1) after theText
  else
 put _printCharXTimes(space, pDimension * 5) &  theKey & ":" && "`"
& pArray[theKey] & "`" & cr after theText
  end if
   end repeat

   return theText
end _PrintKeys
```

As you can see, PrintKeys prints off every key and value in the sDataArray
array. sDataArray contains the array that you, the developer, assigned to
the DataGrid using a property such as dgData or dgText. PrintKeys doesn't
take into account the columns you've created in your DataGrid. That is a
separate property.

So my guess is that you are populating the DataGrid with data that only has
10 columns. Could that be the case?

-- 
Trevor DeVore
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: Help Wrapping HTMLTidy in LCB

2019-12-10 Thread Trevor DeVore via use-livecode
On Mon, Dec 9, 2019 at 12:28 PM Trevor DeVore 
wrote:

> UPDATE:
>
> I made some progress on the HTMLTidy project and this morning Mark
> Waddingham and Brian Milby helped me over the last hurdle. The code base
> now has a tidyHTMLToXHTML() function which works on macOS. You can try it
> out using the test stack included in the repo. The code may also be of
> interest to those trying to wrap other libraries.
>
> https://github.com/trevordevore/lc-htmltidy
>
> I will be adding the Windows DLL so that the extension works on Windows
> and then trying to create a sensible API around HTMLTidy for my current
> needs. I don't plan on making it feature complete at the moment as I just
> need to for my own work. If someone else wanted to take that up they are
> welcome to.
>

I've added Windows support and the ability to pass boolean options so that
you can control the behavior of htmltidy when it cleanses the HTML input.
I've added some sample settings to the test stack for testing.

If anybody would like to add Linux support it should just be a matter of
following the build instructions provided by htmltidy and added the
resulting library to an `x86-linux` folder in the code folder:

https://github.com/trevordevore/lc-htmltidy/tree/master/code

You can find a link to the htmltidy build instructions in the product
README:

https://github.com/trevordevore/lc-htmltidy

-- 
Trevor DeVore
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: Help Wrapping HTMLTidy in LCB

2019-12-09 Thread Trevor DeVore via use-livecode
On Fri, Nov 22, 2019 at 10:30 AM Trevor DeVore 
wrote:

> While looking at solutions for converting HTML into XHTML that can be
> parsed by revXML I decided to test HTMLTidy which has an option to output
> the input as XHTML. While I could bundle up the tidy command line tool and
> include it with my app, I prefer to wrap things up in LCB if possible.
>
> Unfortunately I haven't gotten very far with HTMLTidy and I'm
> hoping someone else might be able to figure out what I'm doing wrong. If
> you are up for loading up an LCB project in LC 9 on macOS and looking at
> some C files then please read on:
>

UPDATE:

I made some progress on the HTMLTidy project and this morning Mark
Waddingham and Brian Milby helped me over the last hurdle. The code base
now has a tidyHTMLToXHTML() function which works on macOS. You can try it
out using the test stack included in the repo. The code may also be of
interest to those trying to wrap other libraries.

https://github.com/trevordevore/lc-htmltidy

I will be adding the Windows DLL so that the extension works on Windows and
then trying to create a sensible API around HTMLTidy for my current needs.
I don't plan on making it feature complete at the moment as I just need to
for my own work. If someone else wanted to take that up they are welcome to.

-- 
Trevor DeVore
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: iOS dark mode

2019-12-07 Thread Trevor DeVore via use-livecode
On Thu, Dec 5, 2019 at 2:58 PM Andrew Bell via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thank you Trevor! Adding this to my info.plist opted out of Dark Mode:
> UIUserInterfaceStyle
> Light
>
> Apple's ominous note at the end of that article gives me the
> impression that before too long (iOS 14?) this override will get the
> app rejected:
> "Supporting Dark Mode is strongly encouraged. Use the
> UIUserInterfaceStyle key to opt out only temporarily while you work on
> improvements to your app's Dark Mode support."
>

I'm glad that solved the immediate problem. Looks like we will need access
to the settings from within LiveCode in the future though.

-- 
Trevor DeVore
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: iOS dark mode

2019-12-04 Thread Trevor DeVore via use-livecode
On Wed, Dec 4, 2019 at 2:30 PM Andrew Bell via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Is there a way to determine if an iOS device has dark mode ("Dark
> Appearance") enabled from within a LiveCode app?
>
> The inherited default text color of a field is black, but is changed
> to white by the OS when this mode is enabled (on a white background in
> this case which makes it appear invisible). This seems to only affect
> native mobile text fields, but not LC text fields.
>
> There is a feature enhancement to support dark mode for macOS, but I
> didn't see any reports for iOS.
> https://quality.livecode.com/show_bug.cgi?id=1
>
> I'm not asking for an engine change, just curious if there is a way to
> check this so I can code around it. Perhaps mergNotify?
>

I don't know of a way to check this from within LiveCode using existing
tools. There is an API for checking which is documented here:

https://developer.apple.com/documentation/uikit/uitraitcollection/1651063-userinterfacestyle?language=objc

It should be possible to wrap that API using LiveCode Builder. From what
I've read, I think you also need to respond to a trailCollectionDidChange
message in case the user changes the setting while your app is open:

https://developer.apple.com/documentation/uikit/uitraitenvironment/1623516-traitcollectiondidchange?language=objc

The easier (temporary) solution would be to tell the OS to use light
appearance for your app. It looks like there is an Info.plist key that you
can add which will force your app to use the light appearance. Perhaps that
will help in your situation?

https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface/choosing_a_specific_interface_style_for_your_ios_app?language=objc#3234550

-- 
Trevor DeVore
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


Adding `the caller` to LiveCode Script

2019-11-26 Thread Trevor DeVore via use-livecode
About 15 years ago Dar Scott added a feature request to have a function
that returns the long ID of the caller's caller's object:

https://quality.livecode.com/show_bug.cgi?id=1954

Two years ago LiveCode Builder added `the caller` which does just that, but
only in LCB. If anyone is looking for a contribution to make to the engine
I am throwing this out there as something to consider: Add `the caller` to
LCS.

Why is this useful?

When writing handlers that send callback messages it is sometimes desirable
to send the message to the object that called the handler. For example,
let's say I have a library that makes REST calls to a server API. This
calls are asynchronous so a handler in the library will need to notify the
caller that the request is finished. If a handler from the library was
called  from a card then I might want the callback to be sent to the card.
If a handler was called from a group then I might want the callback to be
sent to the group.

The current solution is to pass the long id of the object you want the
callback sent to as a parameter to the library handlers. For example:

restAPIGetObjects tId, the long id of me # callback will sent to me

If you aren't using password protected stacks then you can use `the
executioncontexts` to get the information you need to determine the caller.
But when a stack is password protected the necessary information isn't
included in `the executioncontexts`.

I have a recent real world example. I rewrote the REST API interface in an
application I work on to use behaviors that I attach to cards in my UI
stacks. The design allows me to segment REST calls made within a specific
object (card or group) so that callbacks and cleanup are very simple to
manage. The need to pass the long id of the caller as a parameter if I want
the callback for a specific handler to be sent to a group on the card
shouldn't be part of a handlers parameter list, however.

-- 
Trevor DeVore
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: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 7:09 PM scott--- via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor,
>
> Those directions were awesome! I saw the security warning with the
> AppleScript method. Your extension method avoided it. Thank you.


You’re welcome Scott.

-- 
Trevor DeVore
ScreenSteps
___
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: Help Wrapping HTMLTidy in LCB

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 10:52 AM hh via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Is it really worth the work to do that from LCB?


In my opinion, yes. If for no other reason then that with each library that
is wrapped in LCB I learn what the limitations are in LCB or I learn how to
do something that I didn’t know how to do before. There is a lot of code
out in the world that we could benefit from in LiveCode. Not all have as
nice a command line tool as HTMLTidy. Some don’t have a command line tool
at all. Having lots and lots of example of wrapping C, Objective-C, etc.
will help more people wrap libraries and contribute to the community in the
future.

- -
Trevor DeVore
ScreenSteps

>
___
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: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 8:11 AM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> wow, lots of infos, thank you very much, but maybe a little overkill for
> me.
>
> It would suffice for me to get this little snippet to work:
> -
> tell application "System Events"
> set activeApp to name of first application process whose frontmost
> is true
> return activeApp
> end tell
> 
> Works fine in the AppleScript Editor, but I get "execution error" when
> DOing this in LC!?
> Any hints appreciated!
>
> Thanks a lot!


You’re welcome. I don’t know the solution to your problem with AppleScript.
If you do go the AppleScript route just check that you don’t trigger any
security warnings in later versions of macOS. Maybe that isn’t a big deal
for your app but it is worth checking.

- -
Trevor DeVore

>
___
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: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 6:24 AM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi friends,
>
> can we check if our standalone is currently active, means in
> the "foreground" or if it is not active? Know what I mean?
> If yes, how can we do that? LC? AppleScript?
>
> I want to alert the user if the app is active, but not if the app
> is not active.
>

Apple provides API calls to do this and wrapping Objective-C APIs is pretty
straightforward. The APIs you are interested in:

Get frontmost app:
https://developer.apple.com/documentation/appkit/nsworkspace/1532097-frontmostapplication?language=objc

Get bundle identifier of frontmost app:
https://developer.apple.com/documentation/appkit/nsrunningapplication/1529140-bundleidentifier?language=objc

I have a macOS LCB "playground" repo where I test a number of things out
and upload them for others to see. Take a look at
the NSWorkspaceGetFrontmostApplication function:

https://github.com/trevordevore/lc-macos-toolset/blob/master/NSWorkspace/nsworkspace.lcb#L133

You can call it like this:

```
put NSWorkspaceGetFrontmostApplication("bundle id")
```

If I run the function from within LiveCode it returns "com.runrev.livecode".

If I run the following in the message box and switch to Chrome it returns
"com.google.Chrome":

```
wait 1 second;put NSWorkspaceGetFrontmostApplication("bundle id")
```

So I would think it would do what you want. You would, however, need to
compile the nsworkspace.lcb and load the resulting extension in your app.
Here are some quick instructions in case you want to try:

1. Download and unzip repo using "Clone or Download" link found at
https://github.com/trevordevore/lc-macos-toolset
2. Launch LC 9 and open the Extension Builder (EB) from Tools > Extension
Builder menu.
3. Click on the folder icon in top right of EB window and select the
./NSWorkspace/nsworkspace.lcb file.
4. Click on play button in bottom left of EB window.
5. Test `wait 1 second;put NSWorkspaceGetFrontmostApplication("bundle id")`
in the message box. It should return a value.
6. Look in the ./NSWorkspace folder for the module.2.lcm file. This is the
file that can be renamed, added to your application folder, and loaded
using `load extension`.

Regarding step 6 - If you don't want to store your extension externally to
your application you can also use the "+" button in the EB to install the
extension in your LC environment. Now the extension will load whenever you
launch LC and you can select "NSWorkspace" in the Standalone Builder
Inclusions tab so that the extension is bundled with your executable.

-- 
Trevor DeVore
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: Help Wrapping HTMLTidy in LCB

2019-11-22 Thread Trevor DeVore via use-livecode
On Fri, Nov 22, 2019 at 5:31 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor DeVore wrote:
>
>  > HTML may be placed on the clipboard when copying text and images
>  > from web browsers or by our good friend Microsoft Word. Microsoft
>  > Word places some very "interesting" HTML on the clipboard that
>  > needs to be massaged quite a bit before running it through revXML.
>
> Are you suggesting Microsoft has trouble reading open and
> well-documented standards?  Why, I never! ;)


It’s not them, it’s me. Clearly I’m expecting too much.

- -
Trevor DeVore
ScreenSteps

>
___
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: Help Wrapping HTMLTidy in LCB

2019-11-22 Thread Trevor DeVore via use-livecode
On Fri, Nov 22, 2019 at 2:25 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Trevor DeVore wrote:
>
>  > While looking at solutions for converting HTML into XHTML that can be
>  > parsed by revXML I decided to test HTMLTidy which has an option to
>  > output the input as XHTML. While I could bundle up the tidy command
>  > line tool and include it with my app, I prefer to wrap things up in
>  > LCB if possible.
>
> Is conversion to XHTML the way to go?
>
> I've tried using the XML external to parse even RSS files -- ostensibly
> pure XML -- only to find it choke on some of them.  I've gone back to
> hand-crafted pull-parsers.
>

There are definitely other ways to approach the problem I'm trying to
solve. In fact, in other areas of my app I will extract parts of HTML by
without relying on revXML.

In this particular case I already have some LC code that parses HTML placed
on the clipboard and converts it into data structure used by the
application. This was originally implemented using the revXML callback
feature (no tree is created in memory) and that API has worked well for the
conversions I need to make. HTML may be placed on the clipboard when
copying text and images from web browsers or by our good friend Microsoft
Word. Microsoft Word places some very "interesting" HTML on the clipboard
that needs to be massaged quite a bit before running it through revXML.
There is a speed hit that occurs when running some of the regex patterns on
the Word HTML that are used to strip out some markup and do things such as
add quotes around attributes.

Given the code that I have in place already, I would prefer to leverage
HTMLTidy rather than fix every potential "gotcha" or spend time trying to
optimize the code. I'm betting that HTMLTidy can do it better and faster
given how mature it is.

-- 
Trevor DeVore
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


Help Wrapping HTMLTidy in LCB

2019-11-22 Thread Trevor DeVore via use-livecode
Hello,

While looking at solutions for converting HTML into XHTML that can be
parsed by revXML I decided to test HTMLTidy which has an option to output
the input as XHTML. While I could bundle up the tidy command line tool and
include it with my app, I prefer to wrap things up in LCB if possible.

Unfortunately I haven't gotten very far with HTMLTidy and I'm
hoping someone else might be able to figure out what I'm doing wrong. If
you are up for loading up an LCB project in LC 9 on macOS and looking at
some C files then please read on:

RESOURCES

- Github repo with LCB file, a test stack, and compiled HTMLTidy dylib for
testing on macOS: https://github.com/trevordevore/lc-htmltidy
- HTMLTidy github repo where source files are located:
https://github.com/htacg/tidy-html5

WHAT WORKS

In the htmltidy.lcb file I've wrapped some of the simple APIs that return
strings: tidyReleaseDate(), tidyLibraryVersion(), and tidyPlatform(). Those
all work.

WHAT DOESN'T WORK?

tidyHTMLToXHTML() in the htmltidy.lcb file has some test code in it that
isn't working. As a test I want to call `tidyOptGetIdForName()` from the
htmltidy C library and get a valid value returned. I expect the following
code to log `0` but it is logging `104`. I don't think I am creating
the Ctmbstr pointer properly but I don't really know. Here is code from the
htmltidy.lcb file along with links to the ctmbstr definition in the
HTMLTidy source code:

```
variable tCStr as Pointer

-- Attempting to create a Ctmbstr from a LiveCode string
-- ctmbstr:
https://github.com/htacg/tidy-html5/blob/next/include/tidyplatform.h#L607
MCStringConvertToCString("TidyUnknownOption", tCStr)
-- The next handler is logging `104` which is N_TIDY_OPTIONS (error)
-- Appears that tCStr is not the right format.
log c_tidyOptGetIdForName(tCStr)
```

MCStringConvertToCString is defined as follows in the htmltidy.lcb file:

```
foreign handler MCStringConvertToCString(in pString as String, out rCString
as Pointer) returns CBool binds to ""
```

If anyone can provide some pointers or a PR I would really appreciate it.

-- 
Trevor DeVore
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: Effective rect of stacks on Windows 10

2019-10-21 Thread Trevor DeVore via use-livecode
On Mon, Oct 21, 2019 at 1:31 PM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Add your name to this bug:
> https://quality.livecode.com/show_bug.cgi?id=16305
>
> Mark Waddigham chimed in at one point that the Windows API returns the
> 8px border width under Windows 10 - the 1px visible border and a 7px
> "touch area" is apparently how Microsoft views it, so LC's position is
> that this is sort of an OS vendor issue rather than their.
>
> I disagree of course.
>

I agree with your disagreement. I've added my 2 cents.

-- 
Trevor DeVore
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


Effective rect of stacks on Windows 10

2019-10-21 Thread Trevor DeVore via use-livecode
I am looking for input from people who are using `the effective rect of
stack` and the values it reports on Windows. I have some code that uses the
effective rect of a group to determine if the stack is still on the screen
after the user moves the stack or when restoring window positions when an
app relaunches.

On Windows 10 I just noticed that `the effective rect of stack` includes
the drop shadow that appears along the left, bottom, and right of a window
on Windows 10. For my use case including the shadows in the `effective rect
of stack` serves no value. I'm wondering if someone has a use case where it
is helpful to have the drop shadow included in `the effective rect`?

Here is how you can check behavior if you are interested:

EXPECTED RESULT: The effective rect of a stack on Windows would return the
rect of the stack that includes stack borders and title bar.

OBSERVED RESULT: The effective rect includes the drop shadow of the window
in the rect.

RECIPE:
1. Create a new stack
2. Set the topleft of the stack to 0,0
3. `put the effective rect of this stack`. The left of the rect will be a
negative value.
4. `set the effective topleft of this stack to 0,0`. The left of the stack
will be offset by the negative value from (3).

-- 
Trevor DeVore
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: mnemonic working on Windows in LC 9?

2019-10-21 Thread Trevor DeVore via use-livecode
On Mon, Oct 21, 2019 at 9:58 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 10/21/2019 10:49 AM, Trevor DeVore via use-livecode wrote:
> > Does using the mnemonic key to display a menu on Windows work for anybody
> > else in LC 9? I just did the following test and all I hear is a beep:
> >
> ...>
> LC905 stable under WIndows 10 - same here. Pressing ALT shows the
> underlines menu letters in the menubar, but nothing but a beep.
>
> Please let me know the bug number when you file one, as I'd like to
> follow it.


Thanks for testing Paul and Paul. Here is the bug report:

https://quality.livecode.com/show_bug.cgi?id=22420

-- 
Trevor DeVore
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


mnemonic working on Windows in LC 9?

2019-10-21 Thread Trevor DeVore via use-livecode
Does using the mnemonic key to display a menu on Windows work for anybody
else in LC 9? I just did the following test and all I hear is a beep:

1. Launch LC 9 on Windows 10.
2. Press the ALT key. The letter represented by the mnemonic setting of
each menu in the Toolbar is underlined.
3. Press the letter of one of the menus (e.g. "F"). All I hear is a beep
when the File menu should appear.

-- 
Trevor DeVore
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: macOS Notarization helper for Levure

2019-10-09 Thread Trevor DeVore via use-livecode
You’re welcome Marty. Glad you like it.

Trevor DeVore
ScreenSteps

On Wed, Oct 9, 2019 at 11:46 AM Marty Knapp via use-livecode <
use-livecode@lists.runrev.com> wrote:

> You won’t regret it Bob, Levure is a great framework. A big thanks (again)
> to Trevor.
>
> Marty
>
> > On Oct 9, 2019, at 9:39 AM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Brilliant. I really need to move to Levure. I'm going to have another go
> at it.
> >
> > Bob S
> >
> >
> >> On Oct 9, 2019, at 09:35 , Trevor DeVore via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> Hi all,
> >>
> >> After reading the article by Matthias on notarization* I put together a
> >> helper for Levure that will notarize a DMG image when you package your
> >> Levure application. Here is the link:
> >>
> >> https://github.com/trevordevore/levurehelper-macos_notary
> >>
> >> To use it you will need to update to version 0.9.2 of Levure which I
> >> released today. Here are the release notes:
> >>
> >> https://github.com/trevordevore/levure/releases/tag/v0.9.2.0
> >>
> >> If you need help creating a DMG of your app then the dropDMG helper can
> >> take care of that if you have dropDMG:
> >>
> >> https://github.com/trevordevore/levurehelper-dropDMG
> >>
> >> Of course, someone could write a helper that uses Apple's command line
> >> tools to create a DMG as well.
> >>
> >> *
> >>
> http://lessons.livecode.com/m/4071/l/1122100-codesigning-and-notarizing-your-lc-standalone-for-distribution-outside-the-mac-appstore
> >>
> >> --
> >> Trevor DeVore
> >> 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
>
___
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


macOS Notarization helper for Levure

2019-10-09 Thread Trevor DeVore via use-livecode
Hi all,

After reading the article by Matthias on notarization* I put together a
helper for Levure that will notarize a DMG image when you package your
Levure application. Here is the link:

https://github.com/trevordevore/levurehelper-macos_notary

To use it you will need to update to version 0.9.2 of Levure which I
released today. Here are the release notes:

https://github.com/trevordevore/levure/releases/tag/v0.9.2.0

If you need help creating a DMG of your app then the dropDMG helper can
take care of that if you have dropDMG:

https://github.com/trevordevore/levurehelper-dropDMG

Of course, someone could write a helper that uses Apple's command line
tools to create a DMG as well.

*
http://lessons.livecode.com/m/4071/l/1122100-codesigning-and-notarizing-your-lc-standalone-for-distribution-outside-the-mac-appstore

-- 
Trevor DeVore
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: Determine if Windows engine is 32-bit or 64-bit?

2019-10-07 Thread Trevor DeVore via use-livecode
On Mon, Oct 7, 2019 at 9:47 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 2019-10-07 15:41, Trevor DeVore via use-livecode wrote:
> > With LiveCode 9.5 one can deploy 32-bit or 64bit Windows applications.
> > While LiveCode Builder has an `architecture` function that can be used
> > to
> > detect 64-bit, LiveCode Script does not. Does anybody have a function
> > for
> > determine 64-bit vs. 32-bit architecture in LCS?
>
> I think 'the processor' does what you want - well it does the same thing
> as
> 'the architecture' in LCB at least (it returns x86, x86_64, arm64, arm
> or js
> depending on how the engine was compiled).
>

Hmm, looks like the docs need updating. The docs for the `processor` say it
returns the system's CPU chip which is different than how the engine was
compiled. I see there is already a Bug report for it:

https://quality.livecode.com/show_bug.cgi?id=22164

-- 
Trevor DeVore
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: Determine if Windows engine is 32-bit or 64-bit?

2019-10-07 Thread Trevor DeVore via use-livecode
On Mon, Oct 7, 2019 at 9:47 AM Mark Waddingham via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 2019-10-07 15:41, Trevor DeVore via use-livecode wrote:
> > With LiveCode 9.5 one can deploy 32-bit or 64bit Windows applications.
> > While LiveCode Builder has an `architecture` function that can be used
> > to
> > detect 64-bit, LiveCode Script does not. Does anybody have a function
> > for
> > determine 64-bit vs. 32-bit architecture in LCS?
>
> I think 'the processor' does what you want - well it does the same thing
> as
> 'the architecture' in LCB at least (it returns x86, x86_64, arm64, arm
> or js
> depending on how the engine was compiled).
>

Right you are. I think I'll add a "related" entry to `platform` in the docs
that points to `processor`.

Thanks!

-- 
Trevor DeVore
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


Determine if Windows engine is 32-bit or 64-bit?

2019-10-07 Thread Trevor DeVore via use-livecode
With LiveCode 9.5 one can deploy 32-bit or 64bit Windows applications.
While LiveCode Builder has an `architecture` function that can be used to
detect 64-bit, LiveCode Script does not. Does anybody have a function for
determine 64-bit vs. 32-bit architecture in LCS?

-- 
Trevor DeVore
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: LiveCode 9.0.5

2019-10-05 Thread Trevor DeVore via use-livecode
On Fri, Oct 4, 2019 at 6:38 PM Dalton Calford via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 9.05 is for the foolish people who bought the special indy license for
> version 9


Or for those of us creating commercial applications with LiveCode. I know
the memory leak fixes in 9.0.5 improve my applications performance and
fixes crashes that customers were experiencing.

At the moment I can’t set aside time for my team to do the extra testing
required before moving development to 9.5 so I’m very grateful for 9.0.5.

Trevor DeVore
ScreenSteps

>
___
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: ...and Livecode... where are we now?

2019-10-03 Thread Trevor DeVore via use-livecode
On Wed, Oct 2, 2019 at 2:01 PM hh via use-livecode <
use-livecode@lists.runrev.com> wrote:

> > Trevor D. wrote:
> > If that is the case and they can build that revenue source
> > then it should ultimately be a good thing for those of us
> > who don't use LiveCode FM. It is unfortunate that LC has
> > to sit mostly idle for so long though.
>
> All true. But will the idle state of LC ever change again?
>

I believe that it will if LiveCode FM gets traction. I may be wrong.


> Filemaker is updating its features fast and so LiveCode will
> FOREVER try to reach their goal of supporting 99% of the FM
> features: "Version 1.2 of LCFM covers approximately 78% of
> the total FileMaker feature set" ...
>

Creating a great product is a wonderful journey that can go on
indefinitely given the right variables. If LiveCode FM generates lots of
revenue then it will continue on. And hopefully fuel the development of the
underlying technology (LiveCode) that LiveCode FM is built on.

-- 
Trevor DeVore
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: ...and Livecode... where are we now?

2019-10-03 Thread Trevor DeVore via use-livecode
On Thu, Oct 3, 2019 at 4:56 AM Lagi Pittas via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> I'm reading between the
> lines but Trevor probably knows how well it's doing - but the rest of use
> are being treated like mushrooms.
>

Hi Lagi,

I do not have any additional information about how well the FM project or
the company is doing. The last update I received was what others heard at
the LiveCode Conference. My thoughts are based on what I think I would do
if I was in their place.

While I make my business decisions based on what LiveCode can do now (a
wise senior engineer once counseled me not to base my business on what
other companies *might* do), I am very interested in the company's health
as the LiveCode platform affects my ability to deliver great software using
LiveCode in the future. LiveCode is a very ambitious project. The number of
platforms they are trying to support requires an enormous amount of
planning, programming, and other resources to create, maintain, and
improve. I am heavily invested in LiveCode as a platform so I want very
much for the company to have healthy revenue streams.

Based on what I've heard, the LiveCode FM product addresses a very
important problem that companies are willing to pay recurring licensing
fees to overcome. It is a wonderful thing when a company can find a large
pool of customers that have a problem they are willing pay to them you to
solve. So while I'm less enthusiastic about development on LiveCode slowing
down right now, I support the company pursuing this opportunity.

-- 
Trevor DeVore
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: ...and Livecode... where are we now?

2019-10-02 Thread Trevor DeVore via use-livecode
On Wed, Oct 2, 2019 at 1:09 PM Lagi Pittas via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Have a look at the 3 releases of Livecode for FM in the last month to see
> where all the effort is going this is now getting
> ridiculous we get a few scraps   ... Nuff said.
>
> https://filemaker.livecode.com/lcfm-native-1-2-launched/
> https://filemaker.livecode.com/lcfm-native-1-1-ships/
> https://filemaker.livecode.com/lcfm-native-1-0-launched/


I suspect that the quick updates to LiveCode FM are a sign that the launch
at the FileMaker conference generated a lot of interest and there is some
momentum building there. Perhaps they are trying to quickly fill in the
gaps based on that interest so that they can close more licensing deals? If
that is the case and they can build that revenue source then it should
ultimately be a good thing for those of us who don't use LiveCode FM. It is
unfortunate that LC has to sit mostly idle for so long though.

-- 
Trevor DeVore
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


DataView Paginated Scroll

2019-09-20 Thread Trevor DeVore via use-livecode
Howdy folks,

I've uploaded a new behavior built on top of the DataView which facilities
progressively loading paginated API data as you scroll. I needed this for
an application and I've tried to abstract it and document it so that it
might be useful to others.

It is called DataView Paginated Scroll. For those who use APIs that return
"pages" of results (e.g. records 1-20 of 760 records) this extension of the
DataView control greatly simplifies knowing when to ask the server for more
records.

For example, if the user scrolls to the end of the DataView you don't need
all of the results in between the beginning and end. You just need the last
page. The DataView is intelligent in that regard and only requests the lats
page of results to display.

I've updated the DataView Demo project on GitHub with a Pokemon tab that
uses an publicly available API that lists Pokemon. You can find the demo
repo here:

https://github.com/trevordevore/dataview_demo/tree/master

The actual DataView Paginated Scroll helper repo is here:

https://github.com/trevordevore/levurehelper-dataview_paginated_scroll

-- 
Trevor DeVore
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: inter-app communication to LiveCode?

2019-09-19 Thread Trevor DeVore via use-livecode
On Thu, Sep 19, 2019 at 5:25 PM Peter Bogdanoff via use-livecode <
use-livecode@lists.runrev.com> wrote:

> A user asked about “linking” to my desktop LC app from a PDF. Is there
> anything in the PDF spec that does this? His idea was that it the link
> would do more than just opening up my app, but contain data that indicates
> a specified “page” in my app.
>
> My application is Mac/Windows.
>

You can define a url protocol (e.g. myapp://) which can be configured on
Mac or Windows to launch your application. This works with links in a
browser so that a web page can contain a link that launchers your
application. I don't know if it will work from a PDF file, though. It may
depend on the PDF viewer or other variables. It is probably worth trying as
you can embed the "page" number in the url.

On Windows you need to update the Windows Registry. Here is a link to some
code in a library that ships with Levure that will set the appropriate
values in the registry:

https://github.com/trevordevore/levure/blob/develop/framework/helpers/file_system/file_system.livecodescript#L193

You can run this code when your application first launches.

On Mac/iOS you need to add some keys to your Info.plist file. The README
for the library has an example:

https://github.com/trevordevore/levure/tree/develop/framework/helpers/file_system#url-protocols

Once you've set the registry/Info.plist files up (you will need to launch
the app at least once on macOS so it picks up the settings in the plist
file) your app will be launched when the URL protocol is triggered. On
macOS you will handle an appleEvent. You can look at the code in the
library for hints:

https://github.com/trevordevore/levure/blob/develop/framework/helpers/file_system/file_system.livecodescript#L83

For Windows you can read the `commandArguments` when the app launches or,
if the application is already running, handle the `relaunch` command and
use the parameters passed to it.

Hopefully that is enough to get you started.

-- 
Trevor DeVore
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: Stop Integer Coercion to Scientific Notation in JSON

2019-09-13 Thread Trevor DeVore via use-livecode
On Thu, Sep 12, 2019 at 1:42 PM Sannyasin Brahmanathaswami via use-livecode
 wrote:

> Been working Panos off list.
>
> There is a caveat, jsonImport and jsonExport not only "display" but
> "preserve" the scientific notation as a literal string and math will fail.
>
> Panos says: must use, (and include in a standalone)  mergeJson to
> use:  jsonToArray  and arrayToJSON
>

While ArrayToJSON does fix the problem you are experiencing, it does
introduce additional problems. Try the following code:

```
on mouseUp
  put 1 is 1 into tValueA["root"]["boolean_1"]
  put 1 is 0 into tValueA["root"]["boolean_2"]
  put null into tValueA["root"]["null_1"]
  put "100" into tValueA["root"]["text"]
  put 100+0 into tValueA["root"]["number"]
  put ArrayToJSON(tValueA)
end mouseUp
```

The output is as follows:

```
{
  "root": {
"boolean_2": false,
"text": 100,
"null_1": "",
"boolean_1": true,
"number": 100
  }
}

```

ArrayToJSON won't ever quote numbers, even if the variable in LiveCode has
the number stored as a string (and not an integer or a real). Imagine a
user enters the string "100" into a text field and then your app sends that
value to a JSON API. If you send an integer to a JSON API that is expecting
a string you will most likely get an error.

The output would more appropriately be rendered this way:

```

{
  "root": {
"boolean_2": false,
"text": "100",
"null_1": null,
"boolean_1": true,
"number": 100
  }
}

```

Here is a variation on ArrayToJSON that renders the more appropriate output:

```

function ArrayToJSON pArray,pForceRootType,pPretty
  local tKey, e

  repeat for each key tKey in pArray
if pArray[tKey] is an array then
  put "}"(pArray[tKey]) into pArray[tKey]
else if pArray[tKey] is NULL then
  put "null" into pArray[tKey]
else if pArray[tKey] is strictly a boolean \
  or pArray[tKey] is strictly an integer \
  or pArray[tKey] is strictly a real then
  put pArray[tKey] into pArray[tKey]
else
  # treat as a string
  put "}}"[tKey] into pArray[tKey]
end if
  end repeat

  return(mergJSONEncode("pArray",pForceRootType,pPretty))
end ArrayToJSON

```

In my projects I use this modified version of ArrayToJSON to export JSON
and a wrapper around JsonImport to import JSON. In my experience that gets
me the closest to expected values. Unfortunately JsonImport is rather slow,
but it is more accurate. I don't recall all of the nuances as to why though.


Here is my wrapper around JsonImmport:

```

function _importJSON pJSON
  # zero width joiner breaks JSON Importer
  # http://quality.livecode.com/show_bug.cgi?id=19691
  replace numtoCodePoint("0x200D") with empty in pJSON
  return JsonImport(pJSON)
end _importJSON

```

-- 
Trevor DeVore
 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: This Web URL Stopped Working in LiveCode all versions. HELP!

2019-08-21 Thread Trevor DeVore via use-livecode
On Wed, Aug 21, 2019 at 2:29 PM Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> All requested payloads from them are now compressed. I didn't put my API
> key
> in the example. I pay for this service and did not get an email about any
> changes(buy cheap get cheap I guess). This happened in the last few days.
> Did a try/catch and decompress. The app works now. Try/catch feels like a
> kludge. I will try the libURLSetCustomHTTPHeaders route. That might be
> cleaner. I also sent them a support request but will not hold my breath.
>

If you look at the headers the server is sending back the `content-encoding`
is `gzip`. Just check for that and run decompress if present.

-- 
Trevor DeVore
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: OSX High Sierra and Mojave Double Titlebars or Menubars?

2019-07-26 Thread Trevor DeVore via use-livecode
On Fri, Jul 26, 2019 at 9:14 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> Yes, thank you. In LiveCode 905rc1 in Standalones on OSX High Sierra we
> are seeing an odd behavior where -- something happens -- and the mouse
> position in a window (or a multi-window standalone) is displaced
> vertically. When you click or drag, LiveCode thinks - just in the window
> - that the mouse is about 20-30 px above where it currently is.


Do you know if the window opens up with the vertical displacement issue or
is the user interacting with the window without issue and then the vertical
displacement is somehow triggered?

-- 
Trevor DeVore
ScreenSteps

>
___
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: OSX High Sierra and Mojave Double Titlebars or Menubars?

2019-07-26 Thread Trevor DeVore via use-livecode
On Thu, Jul 25, 2019 at 4:05 PM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I recall a recent (last year/this year - I think) bug where under OSX
> High Sierra or Mojave you could end up with double titlebars in your
> windows or perhaps it was double menubars?
>
> I have spent a big chunk of time searching the Livecode Quality Center
> and can not find this bug.
>
> Am I delusional, or was there such a bug and if, so can someone point me
> to it?
>

This? https://quality.livecode.com/show_bug.cgi?id=20923

-- 
Trevor DeVore
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: Rename object

2019-07-04 Thread Trevor DeVore via use-livecode
On Thu, Jul 4, 2019 at 4:27 AM Richmond via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I've lost this . . . having done it several times before . . .
>
> So: I duplicate an object, let's call it img "XXX", so I end up with
> 2 objects called "XXX" (which is problematic), and I wish to
> rename the new version of "XXX" . . .
>
> err . . .
>
> set the name of the last/recent/latest/headache


After using “copy” a reference to the new object is stored in the “it”
variable.

>
set the name of it to “NEWNAME”

-- 
Trevor DeVore
ScreenSteps
___
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: dragData["private"] is not Unicode aware

2019-06-18 Thread Trevor DeVore via use-livecode
On Tue, Jun 18, 2019 at 6:28 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> I should learn how to contribute to updating documentation myself, but I
> have tried setting up GIT on Windows twice without success (obviously I
> am doing something basic wrong).


The good news is that you don’t have to set up Git to contribute. The “This
Week In LiveCode” newsletter has links to video instructions on how to
contribute to the docs using your web browser. Scroll down to the bottom of
the following page and you will see links to them along with doc entries
that need updating:

https://livecode.github.io/this-week-in-livecode/issue/2019/06/17/this-week-in-livecode-182.html

-- 
Trevor DeVore
___
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: Visual Studio 2017 to the rescue

2019-06-10 Thread Trevor DeVore via use-livecode
On Mon, Jun 10, 2019 at 10:19 AM Mark Talluto via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hello Friends,
>
> LiveCode 9.5 dp1 is my favorite LiveCode yet. If you are dipping into
> testing it out, I found something that may save you some time.
>
> If you use mergJSONencode and decode on Windows, you need to make sure you
> have installed the Microsoft Visual C++ Redistributable for Visual Studio
> 2017. Keep in mind there are both x86 and x64 variants.


Thanks for pointing this out Mark. Have you filed a bug report? This is
incorrect behavior. I believe they just need to change some compiler flags
to fix it.


--
Trevor DeVore
ScreenSteps
___
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


  1   2   3   4   >