This has really stumped me. I've got a sub-stack that opens up with a text field, and the user clicks to exit. Works fine. But then I have another handler that users the same text field and I noticed something very wrong.
When the sub-handler closes, the height of this text field is some how set to 1. Now here's the really odd thing. When I trace through the statements in the on closeStack handler, one by one, it doesn't happen. So just before the end closeStack statement, I put in a wait .5 seconds with messages statement, and then it doesn't happen. But a wait 1 millisecond with messages statement isn't long enough, and it does happen.
Any idea how or why the height of a text field is getting set to 1 like this?
Or-- why I need the wait statement.
PS: I'm still working with version 4.6.4.
Mystery: field height goes to 1
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Mystery: field height goes to 1
I am convinced, and this goes back 25 years, that stepping through some of these bewitched handlers works even though running it doesn't. I am also convinced that sometimes this magically fixes whatever gremlin was lodged in the code, and the thing works from then on.
That said, I have no idea what is up with your field. Have you tried deleting it and making a new one with the same properties? I don't suppose locking the size matters?
Keep in touch. These things are annoying.
Craig Newman
That said, I have no idea what is up with your field. Have you tried deleting it and making a new one with the same properties? I don't suppose locking the size matters?
Keep in touch. These things are annoying.
Craig Newman
-
- Posts: 49
- Joined: Sat Jun 16, 2012 7:57 pm
Re: Mystery: field height goes to 1
Hi,
Not an actual answer, but maybe a track:
Maybe some syntax problem. Do you select anything in your script?
Not an actual answer, but maybe a track:
I'd bet that when you use the trace feature, the scope of an instruction in the script changes. I've already been caught by this.townsend wrote:Now here's the really odd thing. When I trace through the statements in the on closeStack handler, one by one, it doesn't happen.
Maybe some syntax problem. Do you select anything in your script?
Best regards,
Didier
Didier
Re: Mystery: field height goes to 1
Thanks for your reply Craig. Good to know I'm not alone.
Okay-- I've upgraded to 5.51 and I've tried deleting and re-creating the text field.
No-- neither of those options worked.
Oh well. All I really have to do is leave in that one line of code, wait .5 seconds with messages, and everything works fine. If this is the worst problem I have with liveCode I'm in good shape. When I was coding with Morfik I used to run into real critical IDE bugs every day. And then with Real Studio, I was coding around oddities and limitations all the time. So in the scope of development platforms, this is really very minor.
And as LittleGreyMan suggested, maybe the scope had changed (whatever than means). There were no Selects-- but in fact-- this was an unusual stack, where I was changing stack size, decorations and windowshape in many ways.
Okay-- I've upgraded to 5.51 and I've tried deleting and re-creating the text field.
No-- neither of those options worked.
Oh well. All I really have to do is leave in that one line of code, wait .5 seconds with messages, and everything works fine. If this is the worst problem I have with liveCode I'm in good shape. When I was coding with Morfik I used to run into real critical IDE bugs every day. And then with Real Studio, I was coding around oddities and limitations all the time. So in the scope of development platforms, this is really very minor.
And as LittleGreyMan suggested, maybe the scope had changed (whatever than means). There were no Selects-- but in fact-- this was an unusual stack, where I was changing stack size, decorations and windowshape in many ways.
-
- Posts: 49
- Joined: Sat Jun 16, 2012 7:57 pm
Re: Mystery: field height goes to 1
I'm new to LiveCode, and more advanced users will correct me if I'm wrong.townsend wrote:And as LittleGreyMan suggested, maybe the scope had changed (whatever than means).
AFAIK, LiveCode IDE is a LiveCode stack, as in similar tools (HyperCard, SuperCard). Maybe when you run in debug mode, some of your instructions in your script interact with the debugger, instead of your stack.
It happened to me with some code pasted from SuperCard, working differently in LiveCode, and a select command probably trapped by the debugger.
The handler did not work the same way in debug mode.
Best regards,
Didier
Didier