[gtkmm] Entry: Added unset_icon().



commit 4b6cd21808000664345ef94f17c972b88988f25e
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Feb 8 10:51:20 2011 +0100

    Entry: Added unset_icon().
    
    * gtk/src/entry.[hg|ccg]: Added unset_icon() because the
    gtk_entry_set_icon_from_*() functions do that when they are passed a NULL.
    Bug #621742 (feuloren)

 ChangeLog         |    8 ++++++++
 gtk/src/entry.ccg |    6 ++++++
 gtk/src/entry.hg  |   12 +++++++++++-
 3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b9c7af9..709aff0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-02-08  Murray Cumming  <murrayc murrayc com>
 
+	Entry: Added unset_icon().
+
+	* gtk/src/entry.[hg|ccg]: Added unset_icon() because the 
+	gtk_entry_set_icon_from_*() functions do that when they are passed a NULL.
+	Bug #621742 (feuloren)
+
+2011-02-08  Murray Cumming  <murrayc murrayc com>
+
 	ComboBoxText: Add warning about not confusing these.
 
 	* gtk/src/comboboxtext.hg: Add a doxygen comment warning people not to 
diff --git a/gtk/src/entry.ccg b/gtk/src/entry.ccg
index c77ec32..bc34e0c 100644
--- a/gtk/src/entry.ccg
+++ b/gtk/src/entry.ccg
@@ -46,6 +46,12 @@ void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPo
   gtk_entry_set_icon_from_gicon(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GIcon*>(Glib::unwrap<Gio::Icon>(icon))); 
 }
 
+void Entry::unset_icon(EntryIconPosition icon_pos)
+{
+  //We could use any one of these set_icon_from_* functions:
+  gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), 0); 
+}
+
 void Entry::set_icon_activatable(bool activatable, EntryIconPosition icon_pos)
 {
   gtk_entry_set_icon_activatable(gobj(), ((GtkEntryIconPosition)(icon_pos)), static_cast<int>(activatable)); 
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 91289c0..4934b3d 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -128,7 +128,7 @@ public:
   _WRAP_METHOD(double get_progress_pulse_step(), gtk_entry_get_progress_pulse_step)
   _WRAP_METHOD(void progress_pulse(), gtk_entry_progress_pulse)
 
-
+  //We hand-code these so we can change the parameter oder, so we can have a default parameter value:
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_pixbuf)
   void set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_pixbuf)
@@ -144,6 +144,16 @@ public:
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_gicon)
   void set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_gicon)
+  
+  /** Do not show any icon in the specified position.
+   * See set_icon_from_pixbuf(), set_icon_from_stock(), set_icon_from_icon_name(), 
+   * and set_icon_from_gicon().
+   *
+   * @param icon_pos The icon position.
+   *
+   * @newin{3,0}
+   */
+  void unset_icon(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY);
 
   _WRAP_METHOD(ImageType get_icon_storage_type(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const, gtk_entry_get_icon_storage_type)
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon_pixbuf(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY), gtk_entry_get_icon_pixbuf, refreturn)



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