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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): 2 new
......
......@@ -432,8 +432,6 @@ do_stock_browser (void)
macro_set_func,
NULL,
NULL);
g_object_unref (G_OBJECT (cell_renderer));
cell_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (treeview),
......@@ -460,8 +458,6 @@ do_stock_browser (void)
NULL,
NULL);
g_object_unref (G_OBJECT (cell_renderer));
align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
......
......@@ -76,10 +76,6 @@ gtk_cell_renderer_get_type (void)
static void
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->visible = TRUE;
cell->width = -1;
......
......@@ -5215,6 +5215,9 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view,
if (tmptree == NULL)
{
*node = tmpnode;
if (tmpnode == NULL)
*tree = NULL;
else
*tree = tmptree;
return TRUE;
}
......@@ -5223,6 +5226,9 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view,
if (i >= depth)
{
*node = tmpnode;
if (tmpnode == NULL)
*tree = NULL;
else
*tree = tmptree;
return FALSE;
}
......@@ -6681,6 +6687,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
g_return_val_if_fail (column->tree_view == NULL, -1);
g_object_ref (G_OBJECT (column));
gtk_object_sink (GTK_OBJECT (column));
if (tree_view->priv->n_columns == 0 &&
GTK_WIDGET_REALIZED (tree_view) &&
......@@ -6762,7 +6769,6 @@ gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view,
va_end (args);
gtk_tree_view_insert_column (tree_view, column, position);
g_object_unref (column);
return tree_view->priv->n_columns;
}
......@@ -6805,8 +6811,6 @@ gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_vie
gtk_tree_view_insert_column (tree_view, column, position);
g_object_unref (column);
return tree_view->priv->n_columns;
}
......
......@@ -277,10 +277,6 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
static void
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->xalign = 0.0;
tree_column->width = 1;
......@@ -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_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell;
......@@ -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_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
cell_info = g_new (GtkTreeViewColumnCellInfo, 1);
cell_info->cell = cell;
......
......@@ -607,7 +607,7 @@ main (int argc, char *argv[])
g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, left_tree_view);
column = gtk_tree_view_column_new_with_attributes ("Visible", cell, NULL);
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_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
......
......@@ -337,7 +337,6 @@ main (int argc, char *argv[])
"text", HOLIDAY_COLUMN, NULL);
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);
g_object_unref (renderer);
/* Alex Column */
renderer = gtk_cell_renderer_toggle_new ();
......@@ -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_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Havoc Column */
renderer = gtk_cell_renderer_toggle_new ();
......@@ -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_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Tim Column */
renderer = gtk_cell_renderer_toggle_new ();
......@@ -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_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
g_object_unref (renderer);
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
......@@ -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_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
gtk_tree_view_column_set_width (GTK_TREE_VIEW_COLUMN (column), 50);
g_object_unref (renderer);
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
......@@ -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_width (GTK_TREE_VIEW_COLUMN (column), 50);
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);
......@@ -451,61 +445,45 @@ main (int argc, char *argv[])
g_object_unref (G_OBJECT (model));
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),
-1, "Holiday Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Alex Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Havoc Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Tim Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Owen Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Dave Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "Visible Column",
renderer,
gtk_cell_renderer_text_new (),
"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),
-1, "World Holiday",
renderer,
gtk_cell_renderer_text_new (),
"text", 7, NULL);
g_object_unref (renderer);
gtk_signal_connect (GTK_OBJECT (tree_view), "realize",
GTK_SIGNAL_FUNC (gtk_tree_view_expand_all),
......
......@@ -92,17 +92,12 @@ main (int argc, char *argv[])
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
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 ();
column = gtk_tree_view_column_new_with_attributes ("Second Word", renderer,
"text", WORD_COLUMN_2,
NULL);
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_2);
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 ();
column = gtk_tree_view_column_new_with_attributes ("Third Word", renderer,
......@@ -110,8 +105,6 @@ main (int argc, char *argv[])
NULL);
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_3);
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 ();
column = gtk_tree_view_column_new_with_attributes ("Fourth Word", renderer,
......@@ -120,8 +113,6 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_sort_column_id (column, WORD_COLUMN_4);
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_window_set_default_size (GTK_WINDOW (window), 400, 400);
......
......@@ -279,9 +279,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 2",
......@@ -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_set_expander_column (tree_view, col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
rend = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (rend), "toggled",
......@@ -323,9 +317,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
/* 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)
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
rend = gtk_cell_renderer_text_new ();
......@@ -361,10 +349,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 6",
......@@ -376,10 +360,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 7",
......@@ -391,9 +371,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 8",
......@@ -405,10 +382,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 9",
......@@ -420,10 +393,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
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 ();
col = gtk_tree_view_column_new_with_attributes ("Column 10",
......@@ -435,9 +404,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
g_object_unref (G_OBJECT (rend));
g_object_unref (G_OBJECT (col));
#endif
/* FALL THRU */
......@@ -453,10 +419,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
setup_column (col);
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:
break;
}
......
......@@ -311,15 +311,11 @@ make_window (gint view_type)
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_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 ();
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_append_column (GTK_TREE_VIEW (tree_view), column);
g_object_unref (G_OBJECT (cell));
g_object_unref (G_OBJECT (column));
/* A few to start */
if (view_type == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment