Mystery: field height goes to 1

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
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Mystery: field height goes to 1

Post by townsend » Thu Jul 12, 2012 10:35 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Mystery: field height goes to 1

Post by dunbarx » Thu Jul 12, 2012 11:22 pm

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

LittleGreyMan
Posts: 49
Joined: Sat Jun 16, 2012 7:57 pm

Re: Mystery: field height goes to 1

Post by LittleGreyMan » Fri Jul 13, 2012 8:03 am

Hi,

Not an actual answer, but maybe a track:
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.
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.

Maybe some syntax problem. Do you select anything in your script?
Best regards,

Didier

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Mystery: field height goes to 1

Post by townsend » Fri Jul 13, 2012 6:23 pm

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.

LittleGreyMan
Posts: 49
Joined: Sat Jun 16, 2012 7:57 pm

Re: Mystery: field height goes to 1

Post by LittleGreyMan » Fri Jul 13, 2012 8:40 pm

townsend wrote:And as LittleGreyMan suggested, maybe the scope had changed (whatever than means).
I'm new to LiveCode, and more advanced users will correct me if I'm wrong.

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

Post Reply