TextMenuItem.h

Go to the documentation of this file.
00001 #ifndef TEXTMENUITEM_H_
00002 #define TEXTMENUITEM_H_
00003 
00004 #include <gtk/gtklabel.h>
00005 #include <gtk/gtkmenuitem.h>
00006 #include <string>
00007 
00008 namespace gtkutil
00009 {
00010 
00014     class TextMenuItem
00015     {
00016             // The text label
00017             GtkWidget* _label;
00018 
00019         public:
00020 
00021             // Constructor
00022             TextMenuItem (const std::string& text) :
00023                 _label(gtk_label_new(text.c_str()))
00024             {
00025             }
00026 
00027             // Operator cast to GtkWidget* for packing into a menu
00028             operator GtkWidget* ()
00029             {
00030                 GtkWidget* menuItem = gtk_menu_item_new();
00031                 gtk_container_add(GTK_CONTAINER(menuItem), _label);
00032                 return menuItem;
00033             }
00034     };
00035 
00036 }
00037 
00038 #endif /*TEXTMENUITEM_H_*/

Generated by  doxygen 1.6.2