Sounds easy enough.
> I thought that I could use the (pre)openStack and the resumeStack
> messages to accomplish this, but I am having a bit of trouble.
>
> Let's assume that stack "A" is open, but stack "B" is not. Clicking on
> the button in stack "A" opens stack "B", and "B" is sent the various
> (pre)Open messages and given the keyboard focus. In the (pre)openStack
> handler for "B" I can go to card "B" of stack "C". Everything is
> cool.
You didn't say whether stacks B or C are substacks of A, in which case
the preOpen messages are sent through A when either B or C is opened.
Also keep in mind that when you run MetaCard in a standalone (non-Home
stack) environment that messages are sent through the first stack
opened *regardles* of whether the other stacks opened are substacks or
other mainstacks.
> I can also use the resumeStack handler in "A" and "B" to go to the
> correct card in "C" whenever the user clicks in stack "A" or "B" and
> therefore gives it the keyboard focus. Again everything fine. (assuming
> click to type, but that's another can of worms)
The messages should be sent in either case, but if you're using
pointer focus stack C will do a lot of card flipping as you move the
mouse around which wouldn't look so hot.
> My problem is the following: If stack "B" is open, and stack "A" has
> the keyboard focus, clicking on the button in stack "A" does not send
> any messages (that I know of) to stack "B", and does not give stack "B"
> the keyboard focus. However, stack "B" is brought to the front, i.e.
> raised, but, as mentioned, is not given the keyboard focus, and hence
> not sent a stackResume message. Are any messages sent to stack "B" in
> this case? It would appear not, as there doesn't seem to be any
> message like stackRaise. I can't therefore change the card in stack "C"
> to "card B".
>
> However, the topStack property is (correctly?) set to stack "B".
There are a several ways around this "feature" of mwm. One is to
close stack "B" before reopening it with topLevel. You could also
just change the card in stack C in the script after the topLevel
command (or write your own function to open stacks that always does
these two things together). You could put an idle handler in stack C
that checks the topStack and sets the card accordingly. You could
force the keyboard focus to go to stack "B" by using the "select"
command to put the cursor in one of the fields with something like
"select text of field x" or "select before line 1 of field x"
> Should (Can??)
> I use the watch command to monitor the topStack property in
> stack "C" and display the correct card whenever it is changed.
No. The topStack is a function, not a property (defaultStack is a
property, the distinction being that you can set the defaultStack, but
not the topStack). And you can't use the watch command on properties
anyway, only on variables. The plan for 2.0 is to drop the watch
command altogether in favor of a real debugger. The equivalent of
watching properties will be adding user-defined properties to objects
with "to get" and "to set" handlers like ToolBook uses.
Does anyone really need the "watch" command other than for debugging?
> Thanks
>
> -Earle
>
> --
> Earle Lowe
> emlowe@fsa.cs
> FSA Corporation
> Performance and system software for UNIX networks.
-- *********************************************************************** * Scott Raney 303-447-3936 Remember: the better you look, * * raney@metacard.com the more you'll see -- Lidia * ***********************************************************************