gtkmm r1058 - in trunk: . gtk/src



Author: murrayc
Date: Mon Nov 10 14:09:49 2008
New Revision: 1058
URL: http://svn.gnome.org/viewvc/gtkmm?rev=1058&view=rev

Log:
2008-11-09  Alexander Shaduri  <ashaduri gmail com>

* gtk/src/cellview.ccg:
* gtk/src/cellview.hg: Added unset_model().

* gtk/src/combobox.ccg:
* gtk/src/combobox.hg: Added unset_model().

* gtk/src/entrycompletion.ccg:
* gtk/src/entrycompletion.hg: Added unset_model().

* gtk/src/iconview.ccg:
* gtk/src/iconview.hg: Added unset_model().

* gtk/src/treeview.hg: Marked unset_model() as available since 2.8.

* gtk/src/gtk_docs_override.xml: Added overrides for
gtk_tree_view_set_model(), gtk_cell_view_set_model(),
gtk_entry_completion_set_model(), gtk_entry_completion_set_model()
and gtk_combo_box_set_model(), because their documentation
contained an incorrect method of unsetting the models.
Bug #555268

Modified:
   trunk/ChangeLog
   trunk/gtk/src/cellview.ccg
   trunk/gtk/src/cellview.hg
   trunk/gtk/src/combobox.ccg
   trunk/gtk/src/combobox.hg
   trunk/gtk/src/entrycompletion.ccg
   trunk/gtk/src/entrycompletion.hg
   trunk/gtk/src/gtk_docs_override.xml
   trunk/gtk/src/iconview.ccg
   trunk/gtk/src/iconview.hg
   trunk/gtk/src/treeview.hg

Modified: trunk/gtk/src/cellview.ccg
==============================================================================
--- trunk/gtk/src/cellview.ccg	(original)
+++ trunk/gtk/src/cellview.ccg	Mon Nov 10 14:09:49 2008
@@ -68,5 +68,10 @@
   pack_start(*cell);
 }
 
+void CellView::unset_model()
+{
+  gtk_cell_view_set_model(gobj(), 0);
+}
+
 
 } //namespace Gtk

Modified: trunk/gtk/src/cellview.hg
==============================================================================
--- trunk/gtk/src/cellview.hg	(original)
+++ trunk/gtk/src/cellview.hg	Mon Nov 10 14:09:49 2008
@@ -71,6 +71,15 @@
   _IGNORE(gtk_cell_view_set_values)
 
   _WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_cell_view_set_model)
+
+  /** Remove the model from the CellView.
+   *
+   * @see set_model().
+   *
+   * @newin2p16
+   */
+  void unset_model();
+
   _WRAP_METHOD(void set_displayed_row(const TreeModel::Path& path), gtk_cell_view_set_displayed_row)
   _WRAP_METHOD(TreeModel::Path get_displayed_row() const, gtk_cell_view_get_displayed_row)
   _WRAP_METHOD(bool get_size_of_row(const TreeModel::Path& path, Requisition& requisition) const, gtk_cell_view_get_size_of_row)

Modified: trunk/gtk/src/combobox.ccg
==============================================================================
--- trunk/gtk/src/combobox.ccg	(original)
+++ trunk/gtk/src/combobox.ccg	Mon Nov 10 14:09:49 2008
@@ -67,6 +67,12 @@
 }
 
 
+void ComboBox::unset_model()
+{
+  gtk_combo_box_set_model(gobj(), 0);
+}
+
+
 void ComboBox::set_row_separator_func(const SlotRowSeparator& slot)
 {
   //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.

Modified: trunk/gtk/src/combobox.hg
==============================================================================
--- trunk/gtk/src/combobox.hg	(original)
+++ trunk/gtk/src/combobox.hg	Mon Nov 10 14:09:49 2008
@@ -112,6 +112,14 @@
   _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_combo_box_get_model, refreturn, constversion)
   _WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_combo_box_set_model)
 
+  /** Remove the model from the ComboBox.
+   *
+   * @see set_model().
+   *
+   * @newin2p16
+   */
+  void unset_model();
+
   typedef TreeView::SlotRowSeparator SlotRowSeparator;  
   
   /** Sets the row separator function, which is used to determine whether a row should be drawn as a separator. 

Modified: trunk/gtk/src/entrycompletion.ccg
==============================================================================
--- trunk/gtk/src/entrycompletion.ccg	(original)
+++ trunk/gtk/src/entrycompletion.ccg	Mon Nov 10 14:09:49 2008
@@ -55,6 +55,11 @@
 namespace Gtk
 {
 
+void EntryCompletion::unset_model()
+{
+  gtk_entry_completion_set_model(gobj(), 0);
+}
+
 void EntryCompletion::set_match_func(const SlotMatch& slot)
 {
   // Create a copy of the slot.  A pointer to this will be passed

Modified: trunk/gtk/src/entrycompletion.hg
==============================================================================
--- trunk/gtk/src/entrycompletion.hg	(original)
+++ trunk/gtk/src/entrycompletion.hg	Mon Nov 10 14:09:49 2008
@@ -76,6 +76,14 @@
   _WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_entry_completion_get_model, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_entry_completion_get_model, refreturn, constversion)
 
+  /** Remove the model from the EntryCompletion.
+   *
+   * @see set_model().
+   *
+   * @newin2p16
+   */
+  void unset_model();
+
   /// For example, bool on_match(const Glib::ustring& key, const TreeModel::const_iterator& iter);
   typedef sigc::slot<bool, const Glib::ustring&, const TreeModel::const_iterator&> SlotMatch;
   

Modified: trunk/gtk/src/gtk_docs_override.xml
==============================================================================
--- trunk/gtk/src/gtk_docs_override.xml	(original)
+++ trunk/gtk/src/gtk_docs_override.xml	Mon Nov 10 14:09:49 2008
@@ -1715,6 +1715,26 @@
 <return></return>
 </function>
 
+<function name="gtk_tree_view_set_model">
+<description>
+Sets the model for a #GtkTreeView.  If the @tree_view already has a model
+set, it will remove it before setting the new model. Use unset_model() to
+unset the old model.
+
+</description>
+<parameters>
+<parameter name="tree_view">
+<parameter_description> A #GtkTreeNode.
+</parameter_description>
+</parameter>
+<parameter name="model">
+<parameter_description> The model.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
 <function name="gtk_ui_manager_add_ui">
 <description>
 Adds a UI element to the current contents of @self.
@@ -1930,6 +1950,28 @@
 <return></return>
 </function>
 
+<function name="gtk_cell_view_set_model">
+<description>
+Sets the model for @cell_view.  If @cell_view already has a model
+set, it will remove it before setting the new model. Use unset_model() to
+unset the old model.
+
+Since: 2.6
+
+</description>
+<parameters>
+<parameter name="cell_view">
+<parameter_description> a #GtkCellView
+</parameter_description>
+</parameter>
+<parameter name="model">
+<parameter_description> a #GtkTreeModel
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
 <function name="gtk_text_iter_forward_search">
 <description>
 Searches forward for @str. Any match is returned by setting 
@@ -2615,6 +2657,29 @@
 </function>
 
 
+<function name="gtk_entry_completion_set_model">
+<description>
+Sets the model for a #GtkEntryCompletion. If @completion already has
+a model set, it will remove it before setting the new model.
+Use unset_model() to unset the old model.
+
+Since: 2.4
+
+</description>
+<parameters>
+<parameter name="completion">
+<parameter_description> A #GtkEntryCompletion.
+</parameter_description>
+</parameter>
+<parameter name="model">
+<parameter_description> The #GtkTreeModel.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+
 <function name="gtk_icon_theme_choose_icon">
 <description>
 Looks up a named icon and returns a structure containing
@@ -2677,6 +2742,30 @@
 </function>
 
 
+<function name="gtk_icon_view_set_model">
+<description>
+Sets the model for a #GtkIconView.
+If the @icon_view already has a model set, it will remove
+it before setting the new model. Use unset_model() to
+unset the old model.
+
+Since: 2.6
+
+</description>
+<parameters>
+<parameter name="icon_view">
+<parameter_description> A #GtkIconView.
+</parameter_description>
+</parameter>
+<parameter name="model">
+<parameter_description> The model.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+
 <function name="gtk_icon_view_set_tooltip_cell">
 <description>
 Sets the tip area of @tooltip to the area which @cell occupies in
@@ -2733,6 +2822,32 @@
 </function>
 
 
+<function name="gtk_combo_box_set_model">
+<description>
+Sets the model used by @combo_box to be @model. Will unset a previously set
+model (if applicable). Use unset_model() to unset the old model.
+
+Note that this function does not clear the cell renderers, you have to
+call gtk_cell_layout_clear() yourself if you need to set up different
+cell renderers for the new model.
+
+Since: 2.4
+
+</description>
+<parameters>
+<parameter name="combo_box">
+<parameter_description> A #GtkComboBox
+</parameter_description>
+</parameter>
+<parameter name="model">
+<parameter_description> A #GtkTreeModel
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+
 <function name="gtk_page_setup_to_file">
 <description>
 This function saves the information from @setup to @file_name.

Modified: trunk/gtk/src/iconview.ccg
==============================================================================
--- trunk/gtk/src/iconview.ccg	(original)
+++ trunk/gtk/src/iconview.ccg	Mon Nov 10 14:09:49 2008
@@ -55,6 +55,11 @@
 //Allow the generated code to work without the prefix:
 typedef IconView::ArrayHandle_TreePaths ArrayHandle_TreePaths;
 
+void IconView::unset_model()
+{
+  gtk_icon_view_set_model(gobj(), 0);
+}
+
 void IconView::selected_foreach(const SlotForeach& slot)
 {
   SlotForeach slot_copy(slot);

Modified: trunk/gtk/src/iconview.hg
==============================================================================
--- trunk/gtk/src/iconview.hg	(original)
+++ trunk/gtk/src/iconview.hg	Mon Nov 10 14:09:49 2008
@@ -58,6 +58,14 @@
   _WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_icon_view_get_model)
   _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_icon_view_get_model, constversion)
 
+  /** Remove the model from the IconView.
+   *
+   * @see set_model().
+   *
+   * @newin2p16
+   */
+  void unset_model();
+
   _WRAP_METHOD(void set_text_column(int column), gtk_icon_view_set_text_column)
   _WRAP_METHOD(void set_text_column(const TreeModelColumnBase& model_column), gtk_icon_view_set_text_column)
   _WRAP_METHOD(int get_text_column() const, gtk_icon_view_get_text_column)

Modified: trunk/gtk/src/treeview.hg
==============================================================================
--- trunk/gtk/src/treeview.hg	(original)
+++ trunk/gtk/src/treeview.hg	Mon Nov 10 14:09:49 2008
@@ -125,6 +125,10 @@
   _WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_tree_view_set_model)
   
   /** Remove the model from the TreeView.
+   *
+   * @see set_model().
+   *
+   * @newin2p8
    */
   void unset_model();
   



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