Page 1 of 1
Command S not working in standalone
Posted: Tue Jun 12, 2012 7:42 pm
by snm
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
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 8:15 pm
by FourthWorld
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
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 8:47 pm
by snm
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
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 9:32 pm
by FourthWorld
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.
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 10:33 pm
by snm
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
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 11:03 pm
by snm
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
Re: Command S not working in standalone
Posted: Tue Jun 12, 2012 11:09 pm
by FourthWorld
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.
