Commit 112eb9b2 authored by Jonathan Blandford's avatar Jonathan Blandford

Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>

	* gtk/gtktreeviewcolumn.c
	(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.

	* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
	(_gtk_tree_view_find_node): If *node is NULL,
	*tree should be NULL too.

	* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
	column/renderers.
	* tests/testtreecolumns.c: ditto
	* tests/testtreefocus.c: ditto
	* tests/testtreesort.c: ditto
	* tests/testtreeview.c: ditto
	* tests/treestoretest.c: ditto
parent 6ffd507d
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
Sun Aug 19 01:44:44 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeviewcolumn.c
(gtk_tree_view_column_pack_{start,end}_cell_renderer): sink cell.
* gtk/gtktreeview.c (gtk_tree_view_insert_column): sink column.
(_gtk_tree_view_find_node): If *node is NULL,
*tree should be NULL too.
* demos/gtk-demo/stock_browser.c (do_stock_browser): don't unref
column/renderers.
* tests/testtreecolumns.c: ditto
* tests/testtreefocus.c: ditto
* tests/testtreesort.c: ditto
* tests/testtreeview.c: ditto
* tests/treestoretest.c: ditto
Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com> Sat Aug 18 04:34:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new * gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
...@@ -432,8 +432,6 @@ do_stock_browser (void) ...@@ -432,8 +432,6 @@ do_stock_browser (void)
macro_set_func, macro_set_func,
NULL, NULL,
NULL); NULL);
g_object_unref (G_OBJECT (cell_renderer));
cell_renderer = gtk_cell_renderer_text_new (); cell_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (treeview), gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (treeview),
...@@ -460,8 +458,6 @@ do_stock_browser (void) ...@@ -460,8 +458,6 @@ do_stock_browser (void)
NULL, NULL,
NULL); NULL);
g_object_unref (G_OBJECT (cell_renderer));
align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0); align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
......
...@@ -76,10 +76,6 @@ gtk_cell_renderer_get_type (void) ...@@ -76,10 +76,6 @@ gtk_cell_renderer_get_type (void)
static void static void
gtk_cell_renderer_init (GtkCellRenderer *cell) gtk_cell_renderer_init (GtkCellRenderer *cell)
{ {
/* FIXME remove on port to GtkObject */
gtk_object_ref (GTK_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
cell->can_activate = FALSE; cell->can_activate = FALSE;
cell->visible = TRUE; cell->visible = TRUE;
cell->width = -1; cell->width = -1;
......
...@@ -5215,7 +5215,10 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view, ...@@ -5215,7 +5215,10 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view,
if (tmptree == NULL) if (tmptree == NULL)
{ {
*node = tmpnode; *node = tmpnode;
*tree = tmptree; if (tmpnode == NULL)
*tree = NULL;
else
*tree = tmptree;
return TRUE; return TRUE;
} }
tmpnode = _gtk_rbtree_find_count (tmptree, indices[i] + 1); tmpnode = _gtk_rbtree_find_count (tmptree, indices[i] + 1);
...@@ -5223,7 +5226,10 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view, ...@@ -5223,7 +5226,10 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view,
if (i >= depth) if (i >= depth)
{ {
*node = tmpnode; *node = tmpnode;
*tree = tmptree; if (tmpnode == NULL)
*tree = NULL;
else
*tree = tmptree;
return FALSE; return FALSE;
} }
tmptree = tmpnode->children; tmptree = tmpnode->children;
...@@ -6681,6 +6687,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, ...@@ -6681,6 +6687,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
g_return_val_if_fail (column->tree_view == NULL, -1); g_return_val_if_fail (column->tree_view == NULL, -1);
g_object_ref (G_OBJECT (column)); g_object_ref (G_OBJECT (column));
gtk_object_sink (GTK_OBJECT (column));
if (tree_view->priv->n_columns == 0 && if (tree_view->priv->n_columns == 0 &&
GTK_WIDGET_REALIZED (tree_view) && GTK_WIDGET_REALIZED (tree_view) &&
...@@ -6762,7 +6769,6 @@ gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view, ...@@ -6762,7 +6769,6 @@ gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view,
va_end (args); va_end (args);
gtk_tree_view_insert_column (tree_view, column, position); gtk_tree_view_insert_column (tree_view, column, position);
g_object_unref (column);
return tree_view->priv->n_columns; return tree_view->priv->n_columns;
} }
...@@ -6805,8 +6811,6 @@ gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_vie ...@@ -6805,8 +6811,6 @@ gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_vie
gtk_tree_view_insert_column (tree_view, column, position); gtk_tree_view_insert_column (tree_view, column, position);
g_object_unref (column);
return tree_view->priv->n_columns; return tree_view->priv->n_columns;
} }
......
...@@ -277,10 +277,6 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class) ...@@ -277,10 +277,6 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
static void static void
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column) gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
{ {
/* FIXME remove on port to GtkObject */
gtk_object_ref (GTK_OBJECT (tree_column));
gtk_object_sink (GTK_OBJECT (tree_column));
tree_column->button = NULL; tree_column->button = NULL;
tree_column->xalign = 0.0; tree_column->xalign = 0.0;
tree_column->width = 1; tree_column->width = 1;
...@@ -1100,6 +1096,7 @@ gtk_tree_view_column_pack_start_cell_renderer (GtkTreeViewColumn *tree_column, ...@@ -1100,6 +1096,7 @@ gtk_tree_view_column_pack_start_cell_renderer (GtkTreeViewColumn *tree_column,
g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell)); g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell));
g_object_ref (G_OBJECT (cell)); g_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1); cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell; cell_info->cell = cell;
...@@ -1125,6 +1122,7 @@ gtk_tree_view_column_pack_end_cell_renderer (GtkTreeViewColumn *tree_column, ...@@ -1125,6 +1122,7 @@ gtk_tree_view_column_pack_end_cell_renderer (GtkTreeViewColumn *tree_column,
g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell)); g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell));
g_object_ref (G_OBJECT (cell)); g_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
cell_info = g_new (GtkTreeViewColumnCellInfo, 1); cell_info = g_new (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell; cell_info->cell = cell;
......
...@@ -607,7 +607,7 @@ main (int argc, char *argv[]) ...@@ -607,7 +607,7 @@ main (int argc, char *argv[])
g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, left_tree_view); g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, left_tree_view);
column = gtk_tree_view_column_new_with_attributes ("Visible", cell, NULL); column = gtk_tree_view_column_new_with_attributes ("Visible", cell, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (left_tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (left_tree_view), column);
g_object_unref (G_OBJECT (column));
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL); gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
......
...@@ -337,7 +337,6 @@ main (int argc, char *argv[]) ...@@ -337,7 +337,6 @@ main (int argc, char *argv[])
"text", HOLIDAY_COLUMN, NULL); "text", HOLIDAY_COLUMN, NULL);
column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1); column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Alex Column */ /* Alex Column */
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
...@@ -355,7 +354,6 @@ main (int argc, char *argv[]) ...@@ -355,7 +354,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Havoc Column */ /* Havoc Column */
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
...@@ -372,7 +370,6 @@ main (int argc, char *argv[]) ...@@ -372,7 +370,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Tim Column */ /* Tim Column */
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
...@@ -390,7 +387,6 @@ main (int argc, char *argv[]) ...@@ -390,7 +387,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
g_object_unref (renderer);
/* Owen Column */ /* Owen Column */
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
...@@ -406,7 +402,6 @@ main (int argc, char *argv[]) ...@@ -406,7 +402,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
g_object_unref (renderer);
/* Owen Column */ /* Owen Column */
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
...@@ -422,7 +417,6 @@ main (int argc, char *argv[]) ...@@ -422,7 +417,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
...@@ -451,61 +445,45 @@ main (int argc, char *argv[]) ...@@ -451,61 +445,45 @@ main (int argc, char *argv[])
g_object_unref (G_OBJECT (model)); g_object_unref (G_OBJECT (model));
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE); gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Holiday Column", -1, "Holiday Column",
renderer, gtk_cell_renderer_text_new (),
"text", 0, NULL); "text", 0, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Alex Column", -1, "Alex Column",
renderer, gtk_cell_renderer_text_new (),
"text", 1, NULL); "text", 1, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Havoc Column", -1, "Havoc Column",
renderer, gtk_cell_renderer_text_new (),
"text", 2, NULL); "text", 2, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Tim Column", -1, "Tim Column",
renderer, gtk_cell_renderer_text_new (),
"text", 3, NULL); "text", 3, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Owen Column", -1, "Owen Column",
renderer, gtk_cell_renderer_text_new (),
"text", 4, NULL); "text", 4, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Dave Column", -1, "Dave Column",
renderer, gtk_cell_renderer_text_new (),
"text", 5, NULL); "text", 5, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Visible Column", -1, "Visible Column",
renderer, gtk_cell_renderer_text_new (),
"text", 6, NULL); "text", 6, NULL);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "World Holiday", -1, "World Holiday",
renderer, gtk_cell_renderer_text_new (),
"text", 7, NULL); "text", 7, NULL);
g_object_unref (renderer);
gtk_signal_connect (GTK_OBJECT (tree_view), "realize", gtk_signal_connect (GTK_OBJECT (tree_view), "realize",
GTK_SIGNAL_FUNC (gtk_tree_view_expand_all), GTK_SIGNAL_FUNC (gtk_tree_view_expand_all),
......
...@@ -92,17 +92,12 @@ main (int argc, char *argv[]) ...@@ -92,17 +92,12 @@ main (int argc, char *argv[])
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_1); gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_1);
g_object_unref (column);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new (); renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Second Word", renderer, column = gtk_tree_view_column_new_with_attributes ("Second Word", renderer,
"text", WORD_COLUMN_2, "text", WORD_COLUMN_2,
NULL); NULL);
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_2); gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_2);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (column);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new (); renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Third Word", renderer, column = gtk_tree_view_column_new_with_attributes ("Third Word", renderer,
...@@ -110,8 +105,6 @@ main (int argc, char *argv[]) ...@@ -110,8 +105,6 @@ main (int argc, char *argv[])
NULL); NULL);
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_3); gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_3);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (column);
g_object_unref (renderer);
renderer = gtk_cell_renderer_text_new (); renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Fourth Word", renderer, column = gtk_tree_view_column_new_with_attributes ("Fourth Word", renderer,
...@@ -120,8 +113,6 @@ main (int argc, char *argv[]) ...@@ -120,8 +113,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_4); gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_4);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (column);
g_object_unref (renderer);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view); gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
......
...@@ -279,9 +279,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -279,9 +279,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_pixbuf_new (); rend = gtk_cell_renderer_text_pixbuf_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 2", col = gtk_tree_view_column_new_with_attributes ("Column 2",
...@@ -296,9 +293,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -296,9 +293,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
gtk_tree_view_set_expander_column (tree_view, col); gtk_tree_view_set_expander_column (tree_view, col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_toggle_new (); rend = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (rend), "toggled", g_signal_connect (G_OBJECT (rend), "toggled",
...@@ -323,9 +317,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -323,9 +317,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_column_set_widget (col, image); gtk_tree_view_column_set_widget (col, image);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_toggle_new (); rend = gtk_cell_renderer_toggle_new ();
/* you could also set this per-row by tying it to a column /* you could also set this per-row by tying it to a column
...@@ -345,9 +336,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -345,9 +336,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
#if 0 #if 0
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
...@@ -361,10 +349,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -361,10 +349,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 6", col = gtk_tree_view_column_new_with_attributes ("Column 6",
...@@ -376,10 +360,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -376,10 +360,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 7", col = gtk_tree_view_column_new_with_attributes ("Column 7",
...@@ -391,9 +371,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -391,9 +371,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 8", col = gtk_tree_view_column_new_with_attributes ("Column 8",
...@@ -405,10 +382,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -405,10 +382,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 9", col = gtk_tree_view_column_new_with_attributes ("Column 9",
...@@ -420,10 +393,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -420,10 +393,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_text_new (); rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 10", col = gtk_tree_view_column_new_with_attributes ("Column 10",
...@@ -435,9 +404,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -435,9 +404,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
#endif #endif
/* FALL THRU */ /* FALL THRU */
...@@ -453,10 +419,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type) ...@@ -453,10 +419,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
setup_column (col); setup_column (col);
gtk_tree_view_insert_column (GTK_TREE_VIEW (tree_view), col, 0); gtk_tree_view_insert_column (GTK_TREE_VIEW (tree_view), col, 0);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
default: default:
break; break;
} }
......
...@@ -311,15 +311,11 @@ make_window (gint view_type) ...@@ -311,15 +311,11 @@ make_window (gint view_type)
column = gtk_tree_view_column_new_with_attributes ("Node ID", cell, "markup", 0, NULL); column = gtk_tree_view_column_new_with_attributes ("Node ID", cell, "markup", 0, NULL);
gtk_tree_view_column_set_sort_column_id (column, 0); gtk_tree_view_column_set_sort_column_id (column, 0);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (G_OBJECT (cell));
g_object_unref (G_OBJECT (column));
cell = gtk_cell_renderer_text_new (); cell = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Random Number", cell, "text", 1, NULL); column = gtk_tree_view_column_new_with_attributes ("Random Number", cell, "text", 1, NULL);
gtk_tree_view_column_set_sort_column_id (column, 1); gtk_tree_view_column_set_sort_column_id (column, 1);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (G_OBJECT (cell));
g_object_unref (G_OBJECT (column));
/* A few to start */ /* A few to start */
if (view_type == 0) if (view_type == 0)
......