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



>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.

--p



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