Hiding and Showing Pallettes

dunbarx at aol.com dunbarx at aol.com
Mon Oct 14 19:03:25 EDT 2013


Hi.


There seem to be NO messages sent when clicking on the titlebar. None at all. I even tried placing a button under the titlebar, to see if messages might pass through, but no dice. It seems that the titlebar belongs more to the finder than to the stack window, if that makes sense, since double clicking on it will minimize it to the dock. (on a Mac)


Craig Newman



-----Original Message-----
From: Andrew Kluthe <andrew at ctech.me>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Mon, Oct 14, 2013 3:00 pm
Subject: Hiding and Showing Pallettes


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

-- 
Regards,

Andrew Kluthe
andrew at ctech.me
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list