Order of children in a VBox



I have an application in which I present a "sequence" definition for
editing. This display consists of a VBox full of widgets that show the
necessary information. When the user clicks OK I construct the real
sequence from those widgets, which allows me to leave the underlying
sequence untouched if the user hits CANCEL.

So, to my question. My method for generating the real sequence from the
editor consists of :

        Program->clear();
        steps = Recipe.get_children();
        for ( iter=steps.begin(); iter != steps.end(); iter++ )
        {
            Gtk::Widget* child = *iter;
            StepDisplay * psd = (StepDisplay*) child;
            Program->push_back ( psd->SeqObj() );
        }

As you can probably work out, this relies on the VBox::get_children()
returning the list of widgets in the order they are displayed. At the
moment I only ever pack them with pack_start() and I don't, as yet,
make any use of remove() or reorder_child().

And here's the question:  This works at the moment, but is it
guaranteed to always work? Will the VBox::get_children() method always
produce the list in order, on any version of GTKmm, even if children
have been shuffled or removed?

Thanks,
Rob


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]