Command S not working in standalone

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Command S not working in standalone

Post by snm » Tue Jun 12, 2012 7:42 pm

Selecting a field and clicking cmd+S on Mac is causing select and hilite all the text in this file as expected when stack is opened in LC.
But after building the standalone and open it this future is not working.

Is it the bug, or should I put the field script to select all the text in it?

Marek

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Command S not working in standalone

Post by FourthWorld » Tue Jun 12, 2012 8:15 pm

snm wrote:Selecting a field and clicking cmd+S on Mac is causing select and hilite all the text in this file as expected when stack is opened in LC.
But after building the standalone and open it this future is not working.

Is it the bug, or should I put the field script to select all the text in it?
No, it's just how operating systems work. All modern OSes don't allow executables to write to themselves - from p299 of the LiveCode User Guide:
Note: A stack file directly attached to a standalone application cannot have changes
saved to it. This stack is bound directly to the executable file that runs. The OS locks an
executable file while it is running. If you want to save changes in your standalone
application, split your stack up until multiple files. A common technique is to create a
"splash screen" stack that contains a welcome screen and then loads the stacks that make
up the rest of your application. These stacks are referenced as stackFiles on this
pane in the standalone settings screen. It is thus possible to automatically update these
component stacks, or to save changes to them. You may also want to consider creating
preference files in the appropriate location on your end user's system (see the
specialFolderPath function and query/setRegistry functions for more
information).
This article by Sarah Reichelt has some helpful tips:

Saving data in LiveCode standalones
http://livecodejournal.com/tutorials/sa ... ution.html
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Command S not working in standalone

Post by snm » Tue Jun 12, 2012 8:47 pm

Thanks Richard for quick answer, but probably you didn't understand my question.I didn't want to save anything with standalone.

I was asking why the behavior of selected text field differ between stack running in LiveCode IDE and the same stack running as standalone. Under LC IDE if you press cmd+S on the keyboard all the text in the field is selected (hilited). But after building the standalone from this stack and run it without LC, this behavior is not as expected - selecting the field works (the box around the field is hilited). But after that if you press cmd+S nothing happen - the field text is not selected as it should.

So my question is if it's a buggy working stack after builded as standalone, or should I do something like programming this future (text hiliting) by myself as field script?

Marek

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Command S not working in standalone

Post by FourthWorld » Tue Jun 12, 2012 9:32 pm

Sorry for the misunderstanding. Cmd-S is so commonly used for Save that I had thought your question related to saving.

For selecting all of a field's text, have you considered using the standard Cmd-A?

As for the difference in behavior between the IDE and the standalone, I agree it should not differ. Can you reproduce this in a very simple demo stack? Sometimes I find the act of making isolated test cases reveals the culprit.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Command S not working in standalone

Post by snm » Tue Jun 12, 2012 10:33 pm

Sorry, it was my fault. You are right, not cmd+S but cmd+A.
I made test stack with only one text field, without any script. The behavior is the same - cmd+A doesn't hilite the text of selected text field.

Marek

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Command S not working in standalone

Post by snm » Tue Jun 12, 2012 11:03 pm

Putting the field script:

Code: Select all

local tkeys, tKey
on commandKeyDown tKey
   if tKey is "a" then select text of field "Field"
end commandKeyDown
makes the future of hiliting all the field working in the standalone.

Maybe it's important there that I didn't program the menu bar with Edit-->Select All menu item???

Marek

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Command S not working in standalone

Post by FourthWorld » Tue Jun 12, 2012 11:09 pm

snm wrote:Maybe it's important there that I didn't program the menu bar with Edit-->Select All menu item???
Indeed it is. No code = no action. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply