Page 1 of 1
"go stack" doesn't "go"
Posted: Thu Aug 29, 2013 5:53 pm
by jawall
Hi,
I have a main stack and a substack. A handler in my main stack does some things and finally has a "go stack" message to my substack. It goes there alright, but immediately returns to the main stack, where it stays. To me it seems the problem is the "focus on" command.
The complete code is very long and complex but here is the relevant portion
Code: Select all
go stack "Sitzplan"
focus on fld w of stack "Sitzplan"
The only way I can keep the stack I navigated to frontmost is inserting an "answer"-line like this (which is not practical):
Code: Select all
go stack "Sitzplan"
answer "Hurliburli"
focus on fld w of stack "Sitzplan"
or
Code: Select all
answer "Hurliburli"
go stack "Sitzplan"
focus on fld w of stack "Sitzplan"
but not
Code: Select all
go stack "Sitzplan"
focus on fld w of stack "Sitzplan"
answer "Hurliburli"
Any ideas?
Thanks
Jawall
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 4:54 am
by dunbarx
Hi.
Well, no way this should be an issue. Are you sure there is no handler lurking somewhere that insinuates itself into the mix? If that really does not seem to be the case, can you comment out all but the "go" and "focus" commands, and see if the mainstack comes back to the front? If it does not, can you then uncomment blocks of code until it does? This is tedious, and sometimes difficult to do without compromising dependent parts of the handler.
Because the commands you are using are as plain and simple as they get. They work as advertised.
Craig Newman
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 7:33 am
by jawall
Thanks dunbarx,
you're absolutely right, this is really plain stuff and should definately work as expected. Following your suggestion:
Code: Select all
go stack "Sitzplan"
-- focus on fld w of stack "Sitzplan"
works as expected, i.e. brings up substack "Sitzplan"
Code: Select all
--go stack "Sitzplan"
focus on fld w of stack "Sitzplan"
has a strange behavior:
the message watcher gives me a sequence of focusin, focusout,focusin,focusout, the last two messages on the field I am aiming at.
The result is that the desired field is not focused as I wanted and expected it.
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 8:13 am
by [-hh]
..........
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 9:50 am
by jawall
Thanx [-hh]
tried your solutions in my environment - to no avail. substack comes up, field is focused, mainstack goes to front. Only way I can keep the substack frontmost is still by inserting an "answer dialog" - which I don't understand at all.
In a totally fresh environment of a main and a substack my initial, as well as all your solutions work.
The question narrows down to 2 things
a) why does "go stack theSubstack" keep theSubstack frontmost but "go stack theSubstack;focus on fld theField" focus the correct field but afterwards returns to the mainstack
b) why does an inserted "answer dialog" prevent from returning to the mainstack
I swear there is no go mainstack handler anywhere near. I do have focusin and focusout handlers in my destination fields though:
Code: Select all
on focusIn
set the backcolor of me to red
end focusIn
on focusOut
set the backcolor of me to empty
end focusOut
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 10:04 am
by jawall
I think I got it!
As I said in my opening post, the complete code is quite correct. Some hundred lines up the code I found a "go theMainstack". Before that I had locked the screen but never unlocked it manually. After taking out the "lock screen" all worked fine. This might also explain why throwing in an answer dialog also gave me the right solution, it unlocked the screen automatically at a point when the handler was still at my substack.
Does that make sense to you?
Thank you again for your input
Jawall
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 2:36 pm
by [-hh]
..........
Re: "go stack" doesn't "go"
Posted: Fri Aug 30, 2013 6:31 pm
by jawall
Thank you [-hh]
Your hint is very helpful, indeed!
I remember back in the days when I learned HyperTalk, I used to do all unlocking manually, because I was taught to. Somewhere down the line I dropped some of those waterproof techniques I have learnt. I did so, I have to admit, out of laziness. The past few days of beating my head against the wall when stepping through the many lines of code I've written for my project during the last 3 months over and over again,the hours of testing and trying to work around a thing I could not explain to myself maybe will get me back to neater programming again
Again, thank you all for your input and discussion.
Jawall