Trying to understand the inner workings of Resizestack
Richard Gaskin
ambassador at fourthworld.com
Mon Mar 14 12:59:14 EDT 2016
Terence Heaford wrote:
> I am using the resizeStack message to know that the window has
> changed size, then I call a routine that redraws a chart. I need
> to send or dispatch to the group that will contain the chart.
>
> How else can I do it?
The simplest and most with-the-grain way to do it is to use the messages
the engine is already providing.
So rather than write this:
on resizeStack pWidth,pHeight
myUpdateGeometry
dispatch "refreshChart" to group "netWorthChart"
--pass resizeStack
end resizeStack
... you could write this:
on resizeStack pWidth,pHeight
myUpdateGeometry
set the rect of grp "netWorthChart" to the rect of me
--- ...or whatever rect is desired
end resizeStack
The in the "netWorthChart" group you can trap the resizeControl message:
on resizeControl
refreshChart
end resizeControl
In very old versions of LC (> 4 years old) the resizeControl message was
only sent to objects when they were resized interactively by the user
manipulating the selection handles with the pointer tool.
With the advent of custom controls this was changes some time in the v5
series so that a group can receive the resizeControl message ANY time
it's resized, whether interactively or via script.
Apparently this powerful change to the resizeControl message hasn't made
its way into that Dictionary entry yet, so I just filed a report for that:
http://quality.livecode.com/show_bug.cgi?id=17118
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list