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



On Monday 15 December 2003 02:05 pm, Anastasios Bassoukos wrote:
> On Mon, 2003-12-15 at 16:22, Maurizio Colucci wrote:
> [snip]
>
> > Thanks, but I don't see how I can use that function to sort a list of
> > buttons by label on O(N logN).
>
> [snip]
>
> Why won't you use a TreeView? You would only need to create a
> Button-like cell renderer.

> Updates and sorting would be automatic, and 
> AFAIK, can deal with lots of data easily.


Thanks, I tried but I got errors:

class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:

	ModelColumns()	{ add(m_col_text); add(m_col_go_button);}

	Gtk::TreeModelColumn<std::string> m_col_text;
	Gtk::TreeModelColumn<Gtk::Button> m_col_go_button; // error here****
};

cd /dat/pub/src/by-mau/tests/gtk/
make -k 
g++ test.cc `pkg-config gtkmm-2.0 --cflags --libs`
/usr/include/gtkmm-2.0/gtkmm/button.h: In static member function `static void Glib::Value<T>::value_copy_func(const GValue*, GValue*) [with T = Gtk::Button]':
/usr/include/gtkmm-2.0/glibmm/value_custom.h:250:   instantiated from `static GType Glib::Value<T>::value_type() [with T = Gtk::Button]'
/usr/include/gtkmm-2.0/gtkmm/treemodelcolumn.h:131:   instantiated from `Gtk::TreeModelColumn<T>::TreeModelColumn() [with T = Gtk::Button]'
test.cc:25:   instantiated from here
/usr/include/gtkmm-2.0/gtkmm/button.h:74: error: `Gtk::Button::Button(const Gtk::Button&)' is private
/usr/include/gtkmm-2.0/glibmm/value_custom.h:280: error: within this context
make: *** [all] Error 1

Compilation exited abnormally with code 2 at Mon Dec 15 18:10:53

I couldn't find an example...
thanks for any info!

maurizio




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