Strange phenomena

J. Landman Gay jacque at
Sun Dec 19 00:44:59 EST 2010

On 12/18/10 11:27 PM, Joe Lewis Wilkins wrote:
> Just built a windows version of my latest app with unusual results. I
> set the size of my cards in an openCard handler in the stacks'
> scripts. The Window's version makes the answer dialogs the same
> height as the windows. Huge! No problems with the Mac Version. Any
> one else encounter this anomaly? And what might have caused this?
> Earlier builds, when I was not routinely setting card size do not do
> this that I recall. Would this not be termed a bug?

Probably something in your scripts. Try referencing the stack by name 
when you set its size. If you're using "this stack" then depending on 
how your scripts are written, it could be resizing the wrong one. That's 
what it sounds like.

But on Windows you shouldn't need to resize the stack. Windows stacks 
should be the same size as they are in the IDE. Check "the platform" and 
only resize if you're on MacOS.

There was a long-standing bug in the engine that caused a bad stack 
resize on Macs but I thought it was fixed recently. The workaround was 
to just turn off destroystack and destroywindow and stacks would resize 
as expected without doing anything else. That's the preferred solution 
and I've used it.

Another way to handle it is not to set the stack's menubar during 
development, just leave it at the top of the window. Then in a 
preopenstack handler, check "the environment" and if it is "standalone" 
then set the menubar of the stack to the group. That will automatically 
force a resize on Macs only and leave the Windows stack alone. That's 
what I've been doing with the last few standalones I've made. The down 
side of doing this is that keyboard command keys aren't available in the 
IDE, since the menubar isn't in the system menu while the IDE is running.

The last solution goes something like this:

on preOpenStack
  if the environment is "standalone"
  then set the menubar of this stack to "myMenuGroup"
end preOpenStack

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list