override the on_row_activated from a Gtk::TreeView



Hi,

I've got a question about the code below. I have my own Clistbox class derived from the Gtk::TreeView class. Now I want to override the on_row_activated signal but I cannot get it fixed. What am I doing wrong ?

And when I'm overriding this function I do not have to reconnect the signal, do I ? I tried it also, but it still doesn't work.

Thanks in advance !!

Greetings

Peter v/d Heide


---- code ----

// header

class Clistbox : public Gtk::TreeView
{
	public:
		Clistbox();
		 ~Clistbox();		

	protected:
void on_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
		
	private:		
		class CmodelColumns : public Gtk::TreeModel::ColumnRecord
 		{
 			public:
				CmodelColumns()
				{
					add(m_col_name);
				}

   			Gtk::TreeModelColumn<Glib::ustring> m_col_name;		
		};  			

		CmodelColumns m_Columns;			
		
		Gtk::ScrolledWindow m_ScrolledWindow;
		Glib::RefPtr<Gtk::ListStore> m_TreeModel;
		Gtk::CellRendererText* m_CellRendererText;
		Gtk::TreeViewColumn* m_ViewColumn;		
		Gtk::TreeModel::Children::iterator iter;		
};


//cpp

Clistbox::Clistbox() : Gtk::TreeView()
{
	m_TreeModel = Gtk::ListStore::create(m_Columns);
	set_model(m_TreeModel);	
	append_column("m_col_name", m_Columns.m_col_name);
	set_headers_visible(false);

	m_ViewColumn = get_column(0);
	Gtk::CellRenderer* cell_renderer = m_ViewColumn->get_first_cell_renderer();
m_CellRendererText = dynamic_cast<Gtk::CellRendererText*>(cell_renderer);
	
	Pango::FontDescription description;
	description.set_size(22000);
	m_CellRendererText->property_font_desc() = description;
	
// signal_row_activated().connect(sigc::mem_fun(*this, &Clistbox::on_row_activated));
}

void
Clistbox::on_row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn* column)
{
	std::cout << "check" << std::endl;
}

---- end code ----






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