Hiding and Showing Pallettes
J. Landman Gay
jacque at hyperactivesw.com
Mon Oct 14 19:16:28 EDT 2013
It's hard to say without seeing your setup, but it sounds like the
handlers are responding to all stacks rather than just the one you want.
That would imply that the stack script is in use, or that your other
"parent" stacks are actually substacks of the main one.
If the parent stack that should respond has only one card, the easiest
way to handle that is to put the suspend/resume handlers into the first
card. That way they will only trigger for that stack. If it has several
cards then the handlers do need to go into the stack script, and you
should add a check to be sure the clicked stack is the correct parent
before taking any action.
On 10/14/13 1:59 PM, Andrew Kluthe wrote:
> Hey Ya'll,
>
> I have a window that has "child windows" that are to be hidden when the
> parent window is not the current focus, but need to float above the parent
> window when the parent window is in focus.
>
> I have tried leveraging suspend and resume to handle hiding and showing
> these child palette windows and this works fine when minimizing and
> restoring windows.
>
> However, this fails when you click the title bar of another parent window.
> the child palette windows just stay in view. There are other things I can
> click get it to act like this as well.
>
> Can anyone recommend a better way to do this? Below are my suspend and
> resume handlers.
>
> the childStacks property referred to below is simply a list of the stacks
> the parent window has launched. It loops through them to see if they still
> exist and hides or shows them if they do exist.
>
> on suspendStack
> put "suspend"
> put the childStacks of me into sChildStacks
> put the mouseStack into sClickedStack
> if sClickedStack contains "load" or sClickedStack contains "scale" then
> exit suspendStack
> end if
> repeat for each line ChildStack in sChildStacks
> if ChildStack is among the lines of the OpenStacks then
> lock messages
> set the bottom of stack ChildStack to the bottom of this stack
> set the right of stack ChildStack to the right of this stack
> if the visible of stack ChildStack is true then
> hide stack ChildStack
> end if
> unlock messages
> end if
> end repeat
> pass suspendStack
> end suspendStack
>
>
> on resumeStack
> put "resume"
> put the childStacks of me into sChildStacks
> repeat for each line ChildStack in sChildStacks
> if ChildStack is among the lines of the OpenStacks then
> lock messages
> set the bottom of stack ChildStack to the bottom of this stack
> set the right of stack ChildStack to the right of this stack
> if the visible of stack ChildStack is false then
> show stack ChildStack
> end if
> unlock messages
> end if
> end repeat
> pass resumeStack
> end resumeStack
>
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list