creating/destroying windows (stacks) on the fly

emlowe@fsa.ca
Tue, 23 May 1995 17:05:38 -0700 (MDT)

Hi, I have the following scenerio, which I believe MetaCard handles
poorly, irrespectively of the licensing, that is I suspect that using
Embedded MetaCard would not solve the problem.

Here is the situation:

Lets say I have a listbox of do-hickeys, which contains 3 do-hickeys,
named like so: (this list box may contain any number of user created
do-hickeys)

foo
bar
ooga

Now, consider the possible ways to edit/or modify these do-hickeys. I
would have a Edit/Modify do-hickey Stack. If the user double clicks on
a do-hickey in the list, then the Edit/Modify Stack is toplevel'ed and
filled with data from whereever. Now assume that this stack is MODAL.
Then there really isn't any problem, since the user can't do anything
until the Edit/Modify window is closed.

However, if I don't want this stack to be modal, but want to user to be
able to Edit/Modify any number of do-hickeys at the same time, MetaCard
seems ill-suited for this task, and the problem isn't entirely with the
licensing.

Let's assume that licensing isn't a problem, that I'm using Embedded
MetaCard or all users have a home stack. The only solution I can think
of is to have a Edit/Modify stack, and "clone" that stack for each
do-hickey the user wants to Edit, and delete the stack upon closing
(user clicks OK, or Cancel, or whatever). This would seem to work,
however, the "clone" command was not designed for this purpose, for
example, it automatically opens the stack for editing, meaning to open
it in another mode requires first a "clone" command and then a "go to"
or "toplevel" or "modeless" etc. command. This results in definite
window flashing and also some "wierd" behaviour that I unfortunately
haven't been able to completely uncover. Also the clone command makes
the stack a substack of the "Home" stack and this requires another
command to change the home stack, which wouldn't be bad, except that it
has, on occasion, resulted in 2 stack windows open with the same name
but one is a substack of "Home" and the other is a substack of
"MyMainStack". (try the following script and call it from a menu button
on a menu stack)

clone stack "blah"
set the name of stack "Copy of blah" to "blah - 1"
set the mainStack of stack "blah - 1" to "my main stack"
topLevel "blah"

Basically, although this approach kinda works, I've had lots of
problems with it.

I was wondering if any one might have a better/alternate solution. I'm
aware that I could pre-create a bunch of Edit/Modify stacks, and use
them instead of always cloning and deleting, but this has a significant
effect on the size of the stack file, and does result in the operation
(Modify) guaranteed not to work in certain circumstances.

Any suggestions are welcome,

-Earle

-- 
Earle Lowe
emlowe@fsa.ca
FSA Corporation
Performance and system software for UNIX networks.