[gtkmm/gtkmm-2-24] ComboBoxText: Make the API for like the one in gtkmm 3.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-24] ComboBoxText: Make the API for like the one in gtkmm 3.
- Date: Thu, 27 Jan 2011 13:59:40 +0000 (UTC)
commit 2f91f111da1c8bae530e400d5d9e5d50e6032f1d
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Jan 27 14:57:06 2011 +0100
ComboBoxText: Make the API for like the one in gtkmm 3.
* gtk/gtkmm.pc.in:
* gtk/gtkmm/comboboxtext.[h|cc]: Deprecate clear_items() in favour of a new
remove_all() method, as in gtkmm 3. This new API was based on the C API,
which now actually exists.
ChangeLog | 8 ++++++++
gtk/gtkmm/comboboxtext.cc | 8 +++++++-
gtk/gtkmm/comboboxtext.h | 10 ++++++++--
3 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 31301d2..c5833e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-27 Murray Cumming <murrayc murrayc-desktop>
+
+ reviewed by: <delete if not using a buddy>
+
+ * gtk/gtkmm.pc.in:
+ * gtk/gtkmm/comboboxtext.cc:
+ * gtk/gtkmm/comboboxtext.h:
+
2011-01-18 Murray Cumming <murrayc murrayc com>
Range: Added get/set_round_digits() and property.
diff --git a/gtk/gtkmm/comboboxtext.cc b/gtk/gtkmm/comboboxtext.cc
index 6094ccf..b3969e3 100644
--- a/gtk/gtkmm/comboboxtext.cc
+++ b/gtk/gtkmm/comboboxtext.cc
@@ -129,11 +129,16 @@ Glib::ustring ComboBoxText::get_active_text() const
//deprecated.
void ComboBoxText::clear()
{
- clear_items();
+ remove_all();
}
void ComboBoxText::clear_items()
{
+ remove_all();
+}
+
+void ComboBoxText::remove_all()
+{
//Ideally, we would just store the ListStore as a member variable, but we forgot to do that and not it would break the ABI.
Glib::RefPtr<Gtk::TreeModel> model = get_model();
Glib::RefPtr<Gtk::ListStore> list_model = Glib::RefPtr<ListStore>::cast_dynamic(model);
@@ -142,6 +147,7 @@ void ComboBoxText::clear_items()
list_model->clear();
}
+
void ComboBoxText::remove_text(const Glib::ustring& text)
{
//Ideally, we would just store the ListStore as a member variable, but we forgot to do that and not it would break the ABI.
diff --git a/gtk/gtkmm/comboboxtext.h b/gtk/gtkmm/comboboxtext.h
index 2534c8f..752547a 100644
--- a/gtk/gtkmm/comboboxtext.h
+++ b/gtk/gtkmm/comboboxtext.h
@@ -97,6 +97,12 @@ public:
* @deprecated Use prepend().
*/
void prepend_text(const Glib::ustring& text);
+
+ /** Remove all items from the drop-down menu.
+ *
+ * @deprecated Use remove_all().
+ */
+ void clear_items();
#endif //GTKMM_DISABLE_DEPRECATED
/** Get the currently-chosen item.
@@ -116,8 +122,8 @@ public:
/** Remove all items from the drop-down menu.
*/
- void clear_items();
-
+ void remove_all();
+
/** Remove the specified item if it is in the drop-down menu.
* @text The text of the item that should be removed.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]