What is the mode of the "Code Editor" stack?

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7586
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: What is the mode of the "Code Editor" stack?

Post by richmond62 » Fri Jul 29, 2022 4:25 pm

it is under the control of the scripter though the style property, and various commands that determine mode including ask, answer, sheet, palette, modeless, and others.
Thank you, that is worth knowing.

Is there any documentation where there is some sort of equivalence table where each style is matched against a specific mode?

The Dictionary offers information anent 4 styles:
-
SShot 2022-07-29 at 18.33.13.png
-
and there are 14 modes (0 - 13).

stam
Posts: 1360
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: What is the mode of the "Code Editor" stack?

Post by stam » Fri Jul 29, 2022 5:06 pm

Mode 0 was the one of interest to me. The alternative was a roundabout way of checking if stack is open and if it's visible - and this doesn't correspond to styles. Another great convenience!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9218
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: What is the mode of the "Code Editor" stack?

Post by FourthWorld » Fri Jul 29, 2022 5:13 pm

richmond62 wrote:
Fri Jul 29, 2022 4:25 pm
Is there any documentation where there is some sort of equivalence table where each style is matched against a specific mode?
Possibly.

The mode property is rarely needed unless one is making window management tools for an IDE.

More common in practice is to control window layering and other behavior with the style property and the various commands for window behavior.

The descriptions of the modes in the Dictionary appear, IIRC, to make it reasonably clear what actions a scripter would take to see each mode.

For example, whatever numeric constant is used for the modeless behavior is achieved by either setting the style of a stack to modeless, or temporarily setting it by using the modeless command.

I don't know for certain whether such a complete listing mapping actions to mode constants exists, because even though I make IDE tools and used to maintain a complete IDE for this engine I've very rarely needed to think about the mode property.

If you'd like to have one it shouldn't take but a few minutes for you to assemble it. Feel free to post what you can easily derive and note any that aren't clear and I'd be happy to fill in the blanks.

And I'm curious, to help me understand user workflows: what are you working on that requires using the mode property?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9218
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: What is the mode of the "Code Editor" stack?

Post by FourthWorld » Fri Jul 29, 2022 5:16 pm

stam wrote:
Fri Jul 29, 2022 5:06 pm
Mode 0 was the one of interest to me. The alternative was a roundabout way of checking if stack is open and if it's visible - and this doesn't correspond to styles. Another great convenience!
That's exactly the sort of edge case where the mode property can be useful.

To help me understand how these language elements are used in practice, can you describe the circumstance where awareness of mode 0 was useful in your work?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 7586
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: What is the mode of the "Code Editor" stack?

Post by richmond62 » Fri Jul 29, 2022 5:17 pm

what are you working on that requires using the mode property?
I am not, but the OP is.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9218
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: What is the mode of the "Code Editor" stack?

Post by FourthWorld » Fri Jul 29, 2022 6:29 pm

richmond62 wrote:
Fri Jul 29, 2022 5:17 pm
what are you working on that requires using the mode property?
I am not, but the OP is.
He was looking for the mode of the Script Editor. IDE stuff, and solved.

Mode is occasionally useful in consumer-facing apps, but not often.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 1360
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: What is the mode of the "Code Editor" stack?

Post by stam » Fri Jul 29, 2022 9:09 pm

FourthWorld wrote:
Fri Jul 29, 2022 5:16 pm
That's exactly the sort of edge case where the mode property can be useful.

To help me understand how these language elements are used in practice, can you describe the circumstance where awareness of mode 0 was useful in your work?
I require unloading of several library (script only) stacks in the IDE for reloading after editing in an external editor. Mode 0 simplifies that, and although i delve into the dictionary and of course pay attention to the forums i had missed his. But this is mainly for an IDE utility as far as my needs go.

Although i don't have a specific need for this in standalone perhaps it might be useful if for example upgrading components that need to be unloaded from memory if running.

Stam

PaulDaMacMan
Posts: 555
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: What is the mode of the "Code Editor" stack?

Post by PaulDaMacMan » Sun Aug 14, 2022 4:45 pm

x they refer to was called revNewScriptEditor
May be obvious but...
That 'revNewScriptEditor' not going to have a mode because it's a script-only stack that's used as a template to generate script editor window UIs, so you may have stacks "revNewScriptEditor 1", "revNewScriptEditor 2", "revNewScriptEditor 3", erc. open if you're doing a lot of script editing, which are transient stacks, they go away after a control/part script is compiled.
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9218
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: What is the mode of the "Code Editor" stack?

Post by FourthWorld » Sun Aug 14, 2022 5:35 pm

Script-only stacks won't have a style property, because of course that format only supports the behavior property but no others.

But the mode of a stack reflects its state once loaded, independent of its storage format.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “LiveCode Builder”