Lock Screen fails in going between substacks?

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
dbowling
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 12
Joined: Mon Apr 17, 2006 6:38 pm

Lock Screen fails in going between substacks?

Post by dbowling » Tue Apr 17, 2007 5:35 am

In OS X, my handler in one substack (in the forground on my screen) goes to another substack to do a quick text find, then returns to the original substack.

In spite of LOCK SCREEN, the second substack, which is open "behind" the original, invariably flashes into the foreground momentarily - is this right?

I've tried multiple LOCK SCREEN's and I've tried the simplest code of PUSH CARD, GO TO STACK, and POP CARD but I cannot get the screen to lock.

The second substack needs to remain visble in my application i.e., I cannot set it invisible.

Thanks for any help with this.

Doug

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Tue Apr 17, 2007 8:57 am

Hi doug,

I'm afraid this is expected behaviour. Lock Screen is relative to the stack window. If the topStack changes by going to another stack, that window will come to front. Maybe you could redesign the way you search the text in the the other stack. If you could paste a code snippet it would be helpful.

All the best,

Malte

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Apr 17, 2007 9:35 am

Hi Doug,

Malte is right, the lock screen command doesn't prevent windows from appearing. They just don't redraw.

To keep a window invisible, use the go command:

Code: Select all

push cd
lock messages
go invisible stack "Stack to Search"
find "string"
put the foundChunk into myChunk
unlock messages
pop cd
However, it is not a good idea to keep data in fields on cards. It would be much better to keep your data in a file or disk or even in a custom property and use your stack only to display the data temporarily. Eventually, this works much faster.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

marielle
Livecode Opensource Backer
Livecode Opensource Backer

Re: Lock Screen fails in going between substacks?

Post by marielle » Tue Apr 17, 2007 9:39 am

dbowling wrote:In OS X, my handler in one substack (in the forground on my screen) goes to another substack to do a quick text find, then returns to the original substack.
The question then is whether you need to physically go to that other stack. You could simply grab the text on another stack by referencing to that control.

Code: Select all

put the long id of card "thisOtherCard" of stack "thisOtherStack" into tCardRef
put the text of field "myCaptivatingStopry" of tCardRef into tText
Would this do the trick?
Last edited by marielle on Tue Apr 17, 2007 4:19 pm, edited 1 time in total.

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

Post by FourthWorld » Tue Apr 17, 2007 4:16 pm

Transition effects operate within a given window.

In Revolution stacks are contained within windows, and the windows are considered a separate entity. This allows you to "go" from one stack to another within the same window.

So to go from one stack to another in the same window you could use:

visual dissolve
go stack "b" in window of stack "a"

dbowling
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 12
Joined: Mon Apr 17, 2006 6:38 pm

Post by dbowling » Wed Apr 18, 2007 3:43 am

Thanks for everyone's responses - I see what I will need to do if I want to avoid the screen changes.

But I wonder if a "between-windows" Lock Screen might ever be added to Rev?

One of the really nice features of Revolution over HC, I thought, is the option of having multiple, simultaneously open windows. But if you want the windows and their contents to relate to one another dynamically, rather than in some pre-scripted way, then it would be much nicer if you could query the contents of a substack/window in the background, i.e., without bringing it forward (say, to decide whether you actually do want to bring it forward). I just think there are a lot of times when you would want to do that.

I know I can work around it but I'll have to keep track of a whole lot more stuff than I would if I could just look into the other window and see what's there.

Thanks again
Doug

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Apr 18, 2007 7:53 am

Hi Doug,

That's what the go invisible command is for. See my previoust post.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

marielle
Livecode Opensource Backer
Livecode Opensource Backer

Post by marielle » Wed Apr 18, 2007 8:50 am

dbowling wrote:I know I can work around it but I'll have to keep track of a whole lot more stuff than I would if I could just look into the other window and see what's there.
Give a try to the long id stuff and you may discover this isn't as bad as you may think.

Compare

Code: Select all

go card "mycard" of stack "mystack"
put the text of field "myfield" into tText
and

Code: Select all

put the long id of card "mycard" of stack "mystack" into tCardRef
put the text of field "myfield" of tCardRef into tText

dbowling
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 12
Joined: Mon Apr 17, 2006 6:38 pm

Post by dbowling » Thu Apr 19, 2007 1:33 am

Marielle, Mark

Thanks for your further comments.

The problem is I want the other windows to always be visible so the user can see them and can click on any chosen one to bring it forward. Thus, "go invisible stack..." won't do as it makes the stack dissappear (or flash momentarily if I immediately set it visible again).

Also, I need to do a "Find", i.e., I don't know in advance which field on which card may or may not have the text I'm looking for. So, I can't specify a particular field and retrieve its text as Marielle suggested.

I probably have bad habits left over from HyperCard and I'm just going to have to re-think how I do things - but I sure wish I could lock that screen.

Doug

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”