Detecting Window's Maximize Window Click

Ken Ray kray at sonsothunder.com
Mon May 29 22:04:28 EDT 2006


> on resizeStack newW,newH,oldW,oldH
>   if the platform is "MacOS" then put 20 into tAdjust
>   else put 0 into tAdjust
>   if oldW = (item 3 of the windowBoundingRect)-tAdjust then
>     put "Maximized"
>   else
>     if newW = (item 3 of the windowBoundingRect)-tAdjust then
>       put "Restored"
>     else
>       put oldW,oldH,newW,newH
>     end if
>   end if
> end resizeStack

Whoops! Sorry - typo! "oldW" and "newW" should be reversed:

on resizeStack newW,newH,oldW,oldH
  if the platform is "MacOS" then put 20 into tAdjust
  else put 0 into tAdjust
  if newW = (item 3 of the windowBoundingRect)-tAdjust then
    put "Maximized"
  else
    if oldW = (item 3 of the windowBoundingRect)-tAdjust then
      put "Restored"
    else
      put oldW,oldH,newW,newH
    end if
  end if
end resizeStack

Thanks,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list