1 #ifndef _GTKMM_CELLRENDERER_GENERATION_H
2 #define _GTKMM_CELLRENDERER_GENERATION_H
5 /* cellrenderer_generation.h
7 * Copyright(C) 2003 The gtkmm Development Team
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or(at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <gtkmm/cellrenderertext.h>
25 #include <gtkmm/cellrendererpixbuf.h>
26 #include <gtkmm/cellrenderertoggle.h>
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 namespace CellRenderer_Generation
35 template<class T_ModelColumnType> //e.g. bool or Glib::ustring.
36 CellRenderer* generate_cellrenderer(bool editable = false)
38 CellRendererText* pCellRenderer = new CellRendererText(); //the default - template specializations will use other renderers.
39 //CellRendererText can render both strings and numerical values.
41 pCellRenderer->property_editable() = editable;
45 #if !defined(__GNUC__) || __GNUC__ > 2
46 // gcc 2.95.x fails in TreeView::append_column_editable if the
47 // following specializations are declared in the header.
49 CellRenderer* generate_cellrenderer<bool>(bool editable);
52 CellRenderer* generate_cellrenderer< Glib::RefPtr<Gdk::Pixbuf> >(bool editable);
56 } //CellRenderer_Generation
57 #endif //DOXYGEN_SHOULD_SKIP_THIS
62 #endif /* _GTKMM_CELLRENDERER_GENERATION_H */