Reading a (BIG) text file one line at a time
Richard Gaskin
ambassador at fourthworld.com
Tue Nov 23 10:58:26 EST 2004
MisterX wrote:
> Unfortunately, all my development is blocked by bug 2431. If you vote for
> it, I will make this stack available again tonite.
Searching for "2431" in Bugzilla returns "Bug 2431 does not exist."
Did you mean #2341? If so, it needn't be a show-stopper: while the
Geometry Manager is a nice convenience it's by no means essential.
Since long before the GM existed the engine has provided a resizeStack
message which can be trapped directly to handle your layout needs. It
is that message that Rev's GM script itself responds to in order to do
its stuff.
While the GM is handy for many layouts, if you have a circumstance it
doesn't handle gracefully yet I suspect it would take only a few minutes
to write your own resizeStack handler that will do what you need. As
highly generalized code, the GM does a lot of extra work in order to
provide its conveniences (the script is about 40+k last time I checked),
so your custom resizeStack handler will likely provide better
performance as well (though the engine is so fast the difference may not
be noticeable).
One of the complexities in generalizing layout adjustments is, as you've
identified in your report, getting the firing order correct: if you
have objects that are placed relative to other objects, you need to make
sure some objects are adjusted before others. While the GM does a
pretty good job at that most of the time, doing it perfectly for all
possible layouts requires something that approaches AI, but with a
custom resizeStack handler you retain total control over the order in
which things happen.
You can save yourself some typing by reducing the number of lines in a
resizeStack handler with something like the handy ObjRect handler
described in this link, so at most you'd have only one line per resized
object:
<http://lists.runrev.com/pipermail/use-revolution/2004-January/029978.html>
Thus far the most complex layout I've scripted a resizeStack handler for
took about an hour; most take less than five minutes. At one line per
resized object, typing a resizeStack handler often takes no longer than
setting properties for the GM.
But even if it took longer, I suspect the time required would be far
less than even the shortest turnaround anyone could reasonably expect
for that bug fix. So while the bug should indeed be fixed, there's
certainly no need to stop development waiting for it.
Carpe diem.
--
Richard Gaskin
Fourth World Media Corporation
__________________________________________________
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode
mailing list