|
|
Stan wrote:
At runtime, I'm stuffing a grid of widgets into an Fl_Scroll.
My program structure demands that the grid is generated
in column-major order, but I'd like a row-major tab order
when I'm done.
I implemented this by using insert() to add each component at its
(currently) correct position. When the grid is large, this is
rather slow. Performance is obviously much better if I add()
each component, then sort the Fl_Scroll's array of children
when I'm all done. It seems to work, but I'm wondering if it's
safe to do.
It's safe enough as long as you don't call Fl::check() or Fl::wait()
while doing so (which could lead to some strange event processing).
Just make sure to only sort if you have more than 1 widget - Fl_Group
uses a plain widget pointer for the 1 child case (optimization).
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
[ Direct Link to Message ] | |
|
| |