All pastes #878984 Raw Edit

Miscellany

public cpp v1 · immutable
#878984 ·published 2008-01-29 15:44 UTC
rendered paste body
sourceedit.hpp:class SourceEdit{	public:		SourceEdit();		SourceEdit(Gtk::TreeView* tree) { SourceEdit(); AddTreeView(tree); };		~SourceEdit();				void AddTreeView(Gtk::TreeView* tree);		void Add();		void Edit();		void Delete();			protected:		std::list<PkgSource> sources;				class ModelColumns : public Gtk::TreeModelColumnRecord		{			public:				ModelColumns() { add(name); add(path); };				Gtk::TreeModelColumn<Glib::ustring> name;				Gtk::TreeModelColumn<Glib::ustring> path;		} model;		Glib::RefPtr<Gtk::ListStore> store;		//Gtk::ListStore store;};sourceedit.cpp:#include "sourceedit.hpp"SourceEdit::SourceEdit(){	Glib::RefPtr<Gtk::ListStore> store = Gtk::ListStore::create(model);	if (true)	{		Gtk::TreeModel::Row row = *(store->append());		row[model.name] = "Boom bang";		row[model.path] = "Abcd";	}}SourceEdit::~SourceEdit(){	}void SourceEdit::AddTreeView(Gtk::TreeView * tree){	tree->set_model(store);	tree->append_column("Name", model.name);	tree->append_column("Path / Address", model.path);	tree->set_headers_visible(true);	tree->set_search_column(model.name.index());}