gtk+ r20935 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20935 - in trunk: . gtk
- Date: Sat, 2 Aug 2008 04:42:37 +0000 (UTC)
Author: matthiasc
Date: Sat Aug 2 04:42:36 2008
New Revision: 20935
URL: http://svn.gnome.org/viewvc/gtk+?rev=20935&view=rev
Log:
Add an example to the docs
Modified:
trunk/ChangeLog
trunk/gtk/gtktreemodelfilter.c
Modified: trunk/gtk/gtktreemodelfilter.c
==============================================================================
--- trunk/gtk/gtktreemodelfilter.c (original)
+++ trunk/gtk/gtktreemodelfilter.c Sat Aug 2 04:42:36 2008
@@ -2884,6 +2884,29 @@
* gtk_tree_model_filter_refilter() to keep the visibility information of
* the model uptodate.
*
+ * Note that @func is called whenever a row is inserted, when it may still be
+ * empty. The visible function should therefore take special care of empty
+ * rows, like in the example below.
+ *
+ * <informalexample><programlisting>
+ * static gboolean
+ * visible_func (GtkTreeModel *model,
+ * GtkTreeIter *iter,
+ * gpointer data)
+ * {
+ * /* Visible if row is non-empty and first column is "HI" */
+ * gchar *str;
+ * gboolean visible = FALSE;
+ *
+ * gtk_tree_model_get (model, iter, 0, &str, -1);
+ * if (str && strcmp (str, "HI") == 0)
+ * visible = TRUE;
+ * g_free (str);
+ *
+ * return visible;
+ * }
+ * </programlisting></informalexample>
+ *
* Since: 2.4
*/
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]