Follow the rev tools palette by a window

zryip theSlug zryip.theslug at
Fri Nov 12 18:16:54 EST 2010

On Mon, Mar 1, 2010 at 10:02 PM, zryip theSlug <zryip.theslug at> wrote:
> Dear list members,
> To follow the rev tools palette by a window (a palette), I use the
> send message in time form below :
> command scanForRevToolsLoc
>   set the topLeft of this stack to the bottomLeft of stack "Revtools"
>   send "scanForRevToolsLoc" to me in 100 milliseconds
> end scanForRevToolsLoc
> This handler works as expect excepted for one thing: it seems that
> dragging the tools palette by it's title bar, give no time to the RR
> engine. So during the drag, nothing is intercepted by the
> scanForRevToolsLoc handler. It performs only when the user release the
> mouse on the palette.
> Is it possible to have something more in "real time"?

I reply myself to this old message I sent. I agree that is a bad
habit, but that is the fault of Richmond!

Instead to use a send in time handler, a possible solution consists to
insert a front script with a moveStack handler.

Here is the front script:

constant kColorPickerName = "ASG_ColorPicker"
constant kToolsPaletteName = "revTools"

on moveStack
   _dockPicker --
   pass moveStack
end moveStack

on resizeStack
   _dockPicker --
   pass resizeStack
end resizeStack

private command _dockPicker
   if (_StackIsToolsPalette()) then
      if (_PickerIsDocked()) then
         send "dockPicker" to cd 1 of stack kColorPickerName
      end if
   end if
end _dockPicker

private function _StackIsToolsPalette
   return (the short name of the owner of the target is kToolsPaletteName)
end _StackIsToolsPalette

private function _PickerIsDocked
   return (the cIsDocked of stack kColorPickerName)
end _PickerIsDocked

And the script to dock the palette to the "revtools" palette:

constant kToolsPaletteName = "revTools"

command dockPicker
   set the topLeft of this stack to the bottomLeft of stack kToolsPaletteName
   go to this stack
end dockPicker

All working now in "real time".

Best regards,
-Zryip TheSlug- wish you the best! 8)

More information about the Use-livecode mailing list