[gtkmm] Widget: Added unset_color/font() methods.



commit 5a8c2d1b7e0f1695bd9beaee7f792e281ddcfb0d
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Dec 9 16:22:04 2010 +0100

    Widget: Added unset_color/font() methods.
    
    	* gdk/src/widget.[hg|ccg]: Add unset_*() methods to match the override_*()
    	methods, because the C functions can take NULLs.

 ChangeLog          |    7 +++++++
 gtk/src/widget.ccg |   25 +++++++++++++++++++++++++
 gtk/src/widget.hg  |   20 +++++++++++++++++++-
 3 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 18ebc52..70fc93c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-12-09  Murray Cumming  <murrayc murrayc com>
 
+	Widget: Added unset_color/font() methods.
+
+	* gdk/src/widget.[hg|ccg]: Add unset_*() methods to match the override_*() 
+	methods, because the C functions can take NULLs.
+
+2010-12-09  Murray Cumming  <murrayc murrayc com>
+
 	Widget: Removed render_icon(), adding render_icon_pixbuf().
 
 	* gtk/src/widget.hg: gtk_widget_render_icon() was deprecated and 
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 039d458..b9c438a 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -427,4 +427,29 @@ void Widget::override_background_color(const Gdk::RGBA& color, StateFlags state)
   gtk_widget_override_background_color(gobj(), ((GtkStateFlags)(state)), (color).gobj()); 
 }
 
+void Widget::unset_color(StateFlags state)
+{
+   gtk_widget_override_color(gobj(), ((GtkStateFlags)(state)), 0); 
+}
+
+void Widget::unset_background_color(StateFlags state)
+{
+  gtk_widget_override_background_color(gobj(), ((GtkStateFlags)(state)), 0); 
+}
+  
+void Widget::unset_font()
+{
+  gtk_widget_override_font(gobj(), 0); 
+}
+  
+void Widget::unset_symbolic_color(const Glib::ustring& name)
+{
+  gtk_widget_override_symbolic_color(gobj(), name.c_str(), 0); 
+}
+  
+void Widget::unset_cursor()
+{
+  gtk_widget_override_cursor(gobj(), 0, 0); 
+}
+
 } // namespace Gtk
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index c6a53a6..528cdcf 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -353,17 +353,35 @@ public:
 
 
 //TODO: Use _WRAP_METHOD() when it allows us to reorder parameters.
-//TODO: Add unset_*() methods?
+
+  //TODO: Documentation.
   void override_color(const Gdk::RGBA& color, StateFlags state = (StateFlags)0);
   _IGNORE(gtk_widget_override_color)
+
+  //TODO: Documentation.
+  void unset_color(StateFlags state = (StateFlags)0);
   
+  //TODO: Documentation.
   void override_background_color(const Gdk::RGBA& color, StateFlags state = (StateFlags)0);
   _IGNORE(gtk_widget_override_background_color)
   
+  //TODO: Documentation.
+  void unset_background_color(StateFlags state = (StateFlags)0);
+  
   _WRAP_METHOD(void override_font(const Pango::FontDescription& font_desc), gtk_widget_override_font)
+  
+  //TODO: Documentation.
+  void unset_font();
+  
   _WRAP_METHOD(void override_symbolic_color(const Glib::ustring& name, const Gdk::RGBA& color), gtk_widget_override_symbolic_color)
+  
+  //TODO: Documentation.
+  void unset_symbolic_color(const Glib::ustring& name);
+  
   _WRAP_METHOD(void override_cursor(const Gdk::RGBA& cursor, const Gdk::RGBA& secondary_cursor), gtk_widget_override_cursor)
 
+  //TODO: Documentation.
+  void unset_cursor();
                                                    
   _IGNORE(gtk_widget_modify_fg, gtk_widget_modify_bg, gtk_widget_modify_font, gtk_widget_modify_text,
      gtk_widget_modify_base, gtk_widget_modify_cursor, gtk_widget_modify_symbolic_color) //deprecated 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]