TextColumn.h

Go to the documentation of this file.
00001 #ifndef TEXTCOLUMN_H_
00002 #define TEXTCOLUMN_H_
00003 
00004 #include <gtk/gtktreeviewcolumn.h>
00005 #include <gtk/gtkcellrenderertext.h>
00006 
00007 namespace gtkutil
00008 {
00014     class TextColumn
00015     {
00016             // Column widget
00017             GtkTreeViewColumn* _column;
00018             GtkCellRenderer* _renderer;
00019 
00020         public:
00021 
00033             TextColumn (const std::string& title, gint colno, bool useMarkup = true)
00034             {
00035                 // Create the cell renderer
00036                 _renderer = gtk_cell_renderer_text_new();
00037 
00038                 // Construct the column itself
00039                 _column = gtk_tree_view_column_new_with_attributes(title.c_str(), _renderer, (useMarkup) ? "markup"
00040                         : "text", colno, NULL);
00041             }
00042 
00043             GtkCellRendererText* getCellRenderer ()
00044             {
00045                 return GTK_CELL_RENDERER_TEXT(_renderer);
00046             }
00047 
00050             operator GtkTreeViewColumn* ()
00051             {
00052                 return _column;
00053             }
00054     };
00055 }
00056 
00057 #endif /*TEXTCOLUMN_H_*/

Generated by  doxygen 1.6.2