Re: [gtkmm] How to sort the widgets in a box?



On Monday 15 December 2003 12:20 pm, Paul Davis wrote:
> >In a file manager, I have a VBox containing a _lot_ of widgets.
> >
> >(each Widget is a HBox containing one ToggleButton and one Button. The
> >ToggleButton contains a label with a filename)
> >
> >I must sort the widgets by filename.
> >Can this be done with gtkmm? I get the children with Box::children(),
> > which is
> >
> >of type Box_helpers::BoxList. But there is no sort() method...
> >
> >(I cannot simply destroy all the widgets and insert them again in the
> > right order, since this takes too much time --- tested).
>
> its O(logN) or worse, but Gtk::Container::reorder_child (Gtk::Widget&,
> gint pos) might help. pos starts at zero.

Thanks, but I don't see how I can use that function to sort a list of buttons 
by label on O(N logN).




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