displaying a stack in a standalone

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

displaying a stack in a standalone

Post by reelstuff » Wed May 04, 2011 3:36 pm

I need to display a small stack inside a standaone, by "getting it" using some method that would work to display that stack inside a standaone.

Is it possible to display a stack in a standalone, I experimented with "get URL" and go stack, but I think I may need to find a method of storing the stack in memory first then I need to find a way to display the stack in some kind of suitable container, like a field for example

Any thoughts on this?

The goal of course it so provide some method of dynamic data to a standalone, when that data could change frequently it would not make sense to distribute a new executable each time that data changed.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: displaying a stack in a standalone

Post by Klaus » Wed May 04, 2011 3:44 pm

Hi reelstuff,

you CANNOT display a stack inside of another stack!
See a stack as a WINDOW and you cannot display a WINDOW any other way than to SHOW the WINDOW by itself. :-)


Best

Klaus

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: displaying a stack in a standalone

Post by reelstuff » Wed May 04, 2011 3:51 pm

It thought it might be that way, so the only other method is to use a browser instance or wait I wonder if a revlet could be made to work?

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 121
Joined: Fri Mar 09, 2007 9:47 pm

Re: displaying a stack in a standalone

Post by jsburnett » Thu May 05, 2011 12:22 am

Reelstuff,

Hi. I am no expert in LiveCode as Klaus is ... but I've seen this question before.
In the past the response has been usually something like ... "why would you want to open another stack in a stack?" (there are usually other 'work arounds' to your 'problem' or 'question').
However what about opening a stack in the window of another stack. To me at least, it appears as if one stack is opening in another.
I made 2 stacks "test1" and "test2"
I put theses scripts in buttons on each stack:
Stack test1:
on mouseUp
put the windowID of this window into wndID
open stack "test2" in window wndID
end mouseUp
Stack test2:
on mouseUp
put the windowID of this window into wndID
open stack "test1" in window wndID
end mouseUp

Wondered what others thought about this?

Thank you.
JSB

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: displaying a stack in a standalone

Post by SparkOut » Thu May 05, 2011 10:09 am

I'm not quite clear what you need to open a stack inside another stack for?
As Klaus says, that's not possible. As JSB says, it's possible to fake a stack window position with the windowId.
Why is this necessary though? If the reason is to be able to update data without recreating a whole standalone then you can certainly do that. Why does the updated data stack need to be visible inside a field? You can (and it's often considered best practice) to separate your code/controls/logic from data in this manner - can you not simply use the existing stack to display data referenced in the other (invisible) stack? What sort of data is it and how volatile? With a standalone control stack and a data stack you can save the data stack when you exit the application and it will be available on next use. Or you can use preference files writing out data to be saved and retrieved.
There are fiddles, fudges and kludges that can be done to help if you need, but I'm not sure exactly why it should be necessary.

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: displaying a stack in a standalone

Post by reelstuff » Thu May 05, 2011 12:04 pm

jsburnett wrote:Reelstuff,

Hi. I am no expert in LiveCode as Klaus is ... but I've seen this question before.
In the past the response has been usually something like ... "why would you want to open another stack in a stack?" (there are usually other 'work arounds' to your 'problem' or 'question').
However what about opening a stack in the window of another stack. To me at least, it appears as if one stack is opening in another.
I made 2 stacks "test1" and "test2"
I put theses scripts in buttons on each stack:
Stack test1:
on mouseUp
put the windowID of this window into wndID
open stack "test2" in window wndID
end mouseUp
Stack test2:
on mouseUp
put the windowID of this window into wndID
open stack "test1" in window wndID
end mouseUp

Wondered what others thought about this?

Thank you.
JSB
Interesting, I like to push the envelope on what is possible, I would not have thought of this.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: displaying a stack in a standalone

Post by Klaus » Thu May 05, 2011 12:06 pm

Yes, SparkOut is right, we need more info about what you want to achieve!
Lots of workarounds possible :D

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: displaying a stack in a standalone

Post by reelstuff » Thu May 05, 2011 12:15 pm

SparkOut wrote:I'm not quite clear what you need to open a stack inside another stack for?
As Klaus says, that's not possible. As JSB says, it's possible to fake a stack window position with the windowId.
Why is this necessary though? If the reason is to be able to update data without recreating a whole standalone then you can certainly do that. Why does the updated data stack need to be visible inside a field? You can (and it's often considered best practice) to separate your code/controls/logic from data in this manner - can you not simply use the existing stack to display data referenced in the other (invisible) stack? What sort of data is it and how volatile? With a standalone control stack and a data stack you can save the data stack when you exit the application and it will be available on next use. Or you can use preference files writing out data to be saved and retrieved.
There are fiddles, fudges and kludges that can be done to help if you need, but I'm not sure exactly why it should be necessary.
Well yes, I have a need to be able to provide some internal data that could and should be updated on a regular basis, however I do not wish to expose the user to this interface at all, So I was looking at a good method of providing multiple streams of data, from within one small container, if you see just as an example I can very quickly update, the information and upload a stack or substack or revlet, or whatever container I can devise or figure out, and the end user never need see this method because it is internal and loaded into memory or into a variable or into a custom array ect.

Call it being lazy, but if I try to handle every method by calling a server and loading a data array, that can work, but then I have to handle say four or five different processes, for each different task, then I would need to write functions to process the data and then I would need to manage that data, internally.

I began to consider if I could have the ease of engine syntax, combined with the quickness of producing an updated stack for distribution, the user would never see the process at all, which is my goal, so it is because I am lazy, and I say this while smiling, because it is because man is lazy that he created tools to serve him better, and that is the motivation behind my wish to find a method of updating graphics, data, servers, connections, and keeping that data separate from the main compiled application.

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Re: displaying a stack in a standalone

Post by reelstuff » Thu May 05, 2011 12:23 pm

Klaus wrote:Yes, SparkOut is right, we need more info about what you want to achieve!
Lots of workarounds possible :D
Thanks Klaus certainly, and a very much sincere thank you, for your reply,

Here is the basic need, I have some graphics and some links to servers, where data is being (video, PDF, PHP source code) (privately stored) So I want to keep that data private as possible without revealing where the data is coming from it is an advantage for me to reduce the amount of bandwidth consumption because of sharing websites that I have embarked upon this trek, it is not a perfect solution, but If I can produce a (shell) type application if someone were to say "share" out that app, then they would only have a shell, and no real intensive data, only when the user enters and completes a registration process through a private server, would they then have access to the "core" product which is a little more bandwidth intensive.

I think that is the heart of the matter, finding a method of distributing valuable dynamic data, to only those individuals who are valid users.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: displaying a stack in a standalone

Post by Klaus » Thu May 05, 2011 5:45 pm

Hmmm, this sounds more like a security problem of your webpage than a Livecode problem!

The data needs to be transferred to the target machine anyway and so it does not matter if
you have this or that stack (inside/outside of each other) involved.
So I actually do not see the need of "a stack inside of a stack".

You could use the build-in encryption to store and load the data from/to the internet
if that is your concern, and only decrypt then on the target machine after the user has
authorized himself. But maybe I did not understand you problem correctly.

Best

Klaus

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

Re: displaying a stack in a standalone

Post by FourthWorld » Thu May 05, 2011 6:02 pm

I had a similar need and solved it by using a .htaccess file to prevent any access without a specific cookie present, which is set earlier by a login screen.

mod_rewrite is a complex but beautiful thing:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply