/* $Id$ */ /* * Cantus Tag Editor * Copyright © 2002-2004 by Samuel Abels * Copyright © 2007 by Tim Huetz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see **/ #ifdef HAVE_CONFIG_H # include #endif #include //#define _DEBUG_ /****************************************************************************** * Constructor/Destructor ******************************************************************************/ PreferencesTree::PreferencesTree() { // Attach the category liststore to the treeview. store = Gtk::ListStore::create(columns); set_model(store); //append_column("Categories", columns.pixbuf); append_column("Categories", columns.caption); get_selection()->signal_changed().connect( sigc::mem_fun(*this, &PreferencesTree::on_selection_changed)); } PreferencesTree::~PreferencesTree() { } /****************************************************************************** * Public ******************************************************************************/ /* Add a category with an icon. */ void PreferencesTree::add(std::string catname, std::string pixmapfile) { Gtk::TreeModel::Row row = *store->append(); //Glib::RefPtr pixbuf; //pixbuf = Gdk::Pixbuf::create_from_file(pixmapfile); //row[columns.pixbuf] = pixbuf; row[columns.caption] = catname; } void PreferencesTree::on_selection_changed(void) { #ifdef _DEBUG_ printf("PreferencesTree::on_selection_changed(): Called.\n"); #endif signal_selection_changed.emit(get_selection()->get_selected()); }