Commit 3b2ffda1 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

renamed "child_toggled" to "has_child_toggled".

Mon Mar  5 14:38:54 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreemodel.c: renamed "child_toggled" to
	"has_child_toggled".

	* gtk/gtktreeview.c: Handle removing columns better.  Updated to
	handle new signal name.

	* gtk/gtktreestore.c: Updated to handle new signal name.
	* gtk/gtklisttore.c: Updated to handle new signal name.
	* gtk/gtktreemodelsort.c: Updated to handle new signal name.
parent e8a62bd8
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
Mon Mar 5 14:38:54 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c: renamed "child_toggled" to
"has_child_toggled".
* gtk/gtktreeview.c: Handle removing columns better. Updated to
handle new signal name.
* gtk/gtktreestore.c: Updated to handle new signal name.
* gtk/gtklisttore.c: Updated to handle new signal name.
* gtk/gtktreemodelsort.c: Updated to handle new signal name.
2001-03-05 Alexander Larsson <alexl@redhat.com>
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
......
......@@ -362,5 +362,5 @@ gtk_cell_renderer_toggle_set_active (GtkCellRendererToggle *toggle,
{
g_return_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (toggle));
g_object_set (G_OBJECT (toggle), "active", setting, NULL);
g_object_set (G_OBJECT (toggle), "active", !! setting, NULL);
}
......@@ -54,17 +54,17 @@ struct _GtkListStoreClass
/* signals */
/* Will be moved into the GtkTreeModelIface eventually */
void (* changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
void (* changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* has_child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
};
......
......@@ -90,10 +90,10 @@ gtk_tree_model_base_init (gpointer g_class)
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
GTK_TYPE_TREE_ITER);
g_signal_newc ("child_toggled",
g_signal_newc ("has_child_toggled",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, child_toggled),
G_STRUCT_OFFSET (GtkTreeModelIface, has_child_toggled),
NULL,
gtk_marshal_VOID__BOXED_BOXED,
G_TYPE_NONE, 2,
......@@ -1027,16 +1027,16 @@ gtk_tree_model_inserted (GtkTreeModel *tree_model,
}
void
gtk_tree_model_child_toggled (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter)
gtk_tree_model_has_child_toggled (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (GTK_IS_TREE_MODEL (tree_model));
g_return_if_fail (path != NULL);
g_return_if_fail (iter != NULL);
g_signal_emit_by_name (tree_model, "child_toggled", path, iter);
g_signal_emit_by_name (tree_model, "has_child_toggled", path, iter);
}
void
......
......@@ -63,7 +63,7 @@ struct _GtkTreeModelIface
void (* inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* child_toggled) (GtkTreeModel *tree_model,
void (* has_child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* deleted) (GtkTreeModel *tree_model,
......@@ -207,17 +207,18 @@ void gtk_tree_model_get_valist (GtkTreeModel *tree_model,
/* Signals */
void gtk_tree_model_changed (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_inserted (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_child_toggled (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_deleted (GtkTreeModel *tree_model,
GtkTreePath *path);
void gtk_tree_model_changed (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_inserted (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_has_child_toggled (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_deleted (GtkTreeModel *tree_model,
GtkTreePath *path);
#ifdef __cplusplus
......
......@@ -62,10 +62,10 @@ static void gtk_tree_model_sort_inserted (GtkTreeModel *
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
static void gtk_tree_model_sort_child_toggled (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
static void gtk_tree_model_sort_has_child_toggled (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
static void gtk_tree_model_sort_deleted (GtkTreeModel *model,
GtkTreePath *path,
gpointer data);
......@@ -240,7 +240,7 @@ gtk_tree_model_sort_set_model (GtkTreeModelSort *tree_model_sort,
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->inserted_id);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->child_toggled_id);
tree_model_sort->has_child_toggled_id);
g_signal_handler_disconnect (G_OBJECT (tree_model_sort->child_model),
tree_model_sort->deleted_id);
......@@ -261,10 +261,10 @@ gtk_tree_model_sort_set_model (GtkTreeModelSort *tree_model_sort,
"inserted",
gtk_tree_model_sort_inserted,
tree_model_sort);
tree_model_sort->child_toggled_id =
tree_model_sort->has_child_toggled_id =
g_signal_connect (child_model,
"child_toggled",
gtk_tree_model_sort_child_toggled,
"has_child_toggled",
gtk_tree_model_sort_has_child_toggled,
tree_model_sort);
tree_model_sort->deleted_id =
g_signal_connect (child_model,
......@@ -492,10 +492,10 @@ gtk_tree_model_sort_inserted (GtkTreeModel *s_model,
}
static void
gtk_tree_model_sort_child_toggled (GtkTreeModel *s_model,
GtkTreePath *s_path,
GtkTreeIter *s_iter,
gpointer data)
gtk_tree_model_sort_has_child_toggled (GtkTreeModel *s_model,
GtkTreePath *s_path,
GtkTreeIter *s_iter,
gpointer data)
{
GtkTreeModelSort *tree_model_sort = GTK_TREE_MODEL_SORT (data);
GtkTreePath *path;
......@@ -521,7 +521,7 @@ gtk_tree_model_sort_child_toggled (GtkTreeModel *s_model,
return;
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
g_signal_emit_by_name (G_OBJECT (data),
"child_toggled",
"has_child_toggled",
path, &iter);
gtk_tree_path_free (path);
if (free_s_path)
......
......@@ -52,27 +52,13 @@ struct _GtkTreeModelSort
guint changed_id;
guint inserted_id;
guint child_toggled_id;
guint has_child_toggled_id;
guint deleted_id;
};
struct _GtkTreeModelSortClass
{
GObjectClass parent_class;
/* signals */
/* Will be moved into the GtkTreeModelIface eventually */
void (* changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
};
......
......@@ -694,7 +694,7 @@ gtk_tree_store_remove (GtkTreeStore *model,
new_iter.stamp = model->stamp;
new_iter.user_data = parent;
gtk_tree_model_child_toggled (GTK_TREE_MODEL (model), path, &new_iter);
gtk_tree_model_has_child_toggled (GTK_TREE_MODEL (model), path, &new_iter);
}
gtk_tree_path_free (path);
}
......@@ -845,7 +845,7 @@ gtk_tree_store_prepend (GtkTreeStore *model,
if (parent_node != model->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), parent);
gtk_tree_model_child_toggled (GTK_TREE_MODEL (model), path, parent);
gtk_tree_model_has_child_toggled (GTK_TREE_MODEL (model), path, parent);
gtk_tree_path_append_index (path, 0);
}
else
......@@ -891,7 +891,7 @@ gtk_tree_store_append (GtkTreeStore *model,
if (parent_node != model->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (model), parent);
gtk_tree_model_child_toggled (GTK_TREE_MODEL (model), path, parent);
gtk_tree_model_has_child_toggled (GTK_TREE_MODEL (model), path, parent);
gtk_tree_path_append_index (path, 0);
}
else
......
......@@ -50,20 +50,6 @@ struct _GtkTreeStore
struct _GtkTreeStoreClass
{
GObjectClass parent_class;
/* signals */
/* Will be moved into the GtkTreeModelIface eventually */
void (* changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
};
......
......@@ -150,7 +150,7 @@ static void gtk_tree_view_inserted (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
static void gtk_tree_view_child_toggled (GtkTreeModel *model,
static void gtk_tree_view_has_child_toggled (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
......@@ -2346,18 +2346,32 @@ gtk_tree_view_remove (GtkContainer *container,
{
child = tmp_list->data;
if (child->widget == widget)
break;
{
gtk_widget_unparent (widget);
tree_view->priv->children = g_list_remove_link (tree_view->priv->children, tmp_list);
g_list_free_1 (tmp_list);
g_free (child);
return;
}
tmp_list = tmp_list->next;
}
if (tmp_list)
{
gtk_widget_unparent (widget);
tmp_list = tree_view->priv->columns;
tree_view->priv->children = g_list_remove_link (tree_view->priv->children, tmp_list);
g_list_free_1 (tmp_list);
g_free (child);
while (tmp_list)
{
GtkTreeViewColumn *column;
column = tmp_list->data;
if (column->button == widget)
{
gtk_widget_unparent (widget);
return;
}
tmp_list = tmp_list->next;
}
}
static void
......@@ -2508,13 +2522,13 @@ gtk_tree_view_inserted (GtkTreeModel *model,
else if (!GTK_RBNODE_FLAG_SET (tmpnode, GTK_RBNODE_IS_PARENT))
{
/* FIXME enforce correct behavior on model, probably */
/* In theory, the model should have emitted child_toggled here. We
/* In theory, the model should have emitted has_child_toggled here. We
* try to catch it anyway, just to be safe, in case the model hasn't.
*/
GtkTreePath *tmppath = _gtk_tree_view_find_path (tree_view,
tree,
tmpnode);
gtk_tree_view_child_toggled (model, tmppath, NULL, data);
gtk_tree_view_has_child_toggled (model, tmppath, NULL, data);
gtk_tree_path_free (tmppath);
goto done;
}
......@@ -2552,10 +2566,10 @@ gtk_tree_view_inserted (GtkTreeModel *model,
}
static void
gtk_tree_view_child_toggled (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
gtk_tree_view_has_child_toggled (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
GtkTreeView *tree_view = (GtkTreeView *)data;
GtkTreeIter real_iter;
......@@ -3494,8 +3508,8 @@ gtk_tree_view_setup_model (GtkTreeView *tree_view)
gtk_tree_view_inserted,
tree_view);
g_signal_connect (tree_view->priv->model,
"child_toggled",
gtk_tree_view_child_toggled,
"has_child_toggled",
gtk_tree_view_has_child_toggled,
tree_view);
g_signal_connect (tree_view->priv->model,
"deleted",
......@@ -3550,7 +3564,7 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
g_signal_handlers_disconnect_matched (G_OBJECT (tree_view->priv->model),
G_SIGNAL_MATCH_FUNC,
0, 0, NULL,
gtk_tree_view_child_toggled, NULL);
gtk_tree_view_has_child_toggled, NULL);
g_signal_handlers_disconnect_matched (G_OBJECT (tree_view->priv->model),
G_SIGNAL_MATCH_FUNC,
0, 0, NULL,
......@@ -3920,14 +3934,32 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view,
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), -1);
g_return_val_if_fail (column->tree_view == GTK_WIDGET (tree_view), -1);
tree_view->priv->columns = g_list_remove (tree_view->priv->columns,
column);
column->tree_view = NULL;
_gtk_tree_view_column_unset_tree_view (column);
tree_view->priv->columns = g_list_remove (tree_view->priv->columns, column);
g_object_unref (G_OBJECT (column));
tree_view->priv->n_columns--;
if (GTK_WIDGET_REALIZED (tree_view))
{
GList *list;
for (list = tree_view->priv->columns; list; list = list->next)
{
column = GTK_TREE_VIEW_COLUMN (list->data);
if (column->visible)
column->dirty = TRUE;
}
if (tree_view->priv->n_columns == 0 &&
gtk_tree_view_get_headers_visible (tree_view))
gdk_window_hide (tree_view->priv->header_window);
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
}
return tree_view->priv->n_columns;
}
......@@ -3956,16 +3988,34 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view,
g_object_ref (G_OBJECT (column));
if (tree_view->priv->n_columns == 0 &&
GTK_WIDGET_REALIZED (tree_view) &&
gtk_tree_view_get_headers_visible (tree_view))
{
gdk_window_show (tree_view->priv->header_window);
}
tree_view->priv->columns = g_list_insert (tree_view->priv->columns,
column, position);
_gtk_tree_view_column_set_tree_view (column, tree_view);
_gtk_tree_view_column_create_button (column);
tree_view->priv->n_columns++;
if (GTK_WIDGET_REALIZED (tree_view))
{
GList *list;
for (list = tree_view->priv->columns; list; list = list->next)
{
column = GTK_TREE_VIEW_COLUMN (list->data);
if (column->visible)
column->dirty = TRUE;
}
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
}
return tree_view->priv->n_columns;
}
......
......@@ -583,7 +583,6 @@ _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
if (column->tree_view && column->button)
{
gtk_container_remove (GTK_CONTAINER (column->tree_view), column->button);
g_print ("removing the button\n");
}
column->tree_view = NULL;
......@@ -897,13 +896,13 @@ gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
if (visible)
{
gtk_widget_show (tree_column->button);
if (GTK_WIDGET_REALIZED (tree_column->tree_view))
if (GTK_WIDGET_REALIZED (tree_column->tree_view) && tree_column->window)
gdk_window_show (tree_column->window);
}
else
{
gtk_widget_hide (tree_column->button);
if (GTK_WIDGET_REALIZED (tree_column->tree_view))
if (GTK_WIDGET_REALIZED (tree_column->tree_view) && tree_column->window)
gdk_window_hide (tree_column->window);
}
......@@ -950,6 +949,12 @@ gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
return;
tree_column->column_type = type;
g_object_notify (G_OBJECT (tree_column), "sizing");
if (tree_column->tree_view == NULL)
return;
switch (type)
{
case GTK_TREE_VIEW_COLUMN_AUTOSIZE:
......@@ -968,8 +973,6 @@ gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
}
gtk_widget_queue_resize (tree_column->tree_view);
g_object_notify (G_OBJECT (tree_column), "sizing");
}
/**
......@@ -1035,11 +1038,15 @@ gtk_tree_view_column_set_width (GtkTreeViewColumn *tree_column,
return;
tree_column->width = size;
g_object_notify (G_OBJECT (tree_column), "width");
if (tree_column->tree_view == NULL)
return;
if (GTK_WIDGET_REALIZED (tree_column->tree_view))
gtk_widget_queue_resize (tree_column->tree_view);
g_object_notify (G_OBJECT (tree_column), "width");
}
/**
......
......@@ -21,6 +21,7 @@ add_clicked (GtkWidget *button, gpointer data)
cell = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (label, cell, "text", 0, NULL);
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_RESIZEABLE);
gtk_list_store_append (GTK_LIST_STORE (left_tree_model), &iter);
gtk_list_store_set (GTK_LIST_STORE (left_tree_model), &iter, 0, label, 1, column, -1);
g_free (label);
......@@ -38,8 +39,10 @@ get_visible (GtkTreeViewColumn *tree_column,
gtk_tree_model_get (tree_model, iter, 1, &column, -1);
if (column)
gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cell),
column->visible);
{
gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cell),
column->visible);
}
}
static void
......@@ -160,6 +163,7 @@ main (int argc, char *argv[])
/* Set up the test windows. */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Top Window");
swindow = gtk_scrolled_window_new (NULL, NULL);
sample_tree_view_top = gtk_tree_view_new_with_model (sample_model);
gtk_container_add (GTK_CONTAINER (window), swindow);
......@@ -167,6 +171,7 @@ main (int argc, char *argv[])
gtk_widget_show_all (window);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Bottom Window");
swindow = gtk_scrolled_window_new (NULL, NULL);
sample_tree_view_bottom = gtk_tree_view_new_with_model (sample_model);
gtk_container_add (GTK_CONTAINER (window), swindow);
......@@ -253,6 +258,12 @@ main (int argc, char *argv[])
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (top_right_tree_view), -1,
NULL, cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (cell), "toggled", set_visible, top_right_tree_view);
column = gtk_tree_view_column_new_with_attributes (NULL, cell, NULL);
gtk_tree_view_column_set_cell_data_func (column, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (top_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), top_right_tree_view);
gtk_box_pack_start (GTK_BOX (vbox2), swindow, TRUE, TRUE, 0);
......@@ -262,6 +273,11 @@ main (int argc, char *argv[])
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (bottom_right_tree_view), -1,
NULL, cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (cell), "toggled", set_visible, bottom_right_tree_view);
column = gtk_tree_view_column_new_with_attributes (NULL, cell, NULL);
gtk_tree_view_column_set_cell_data_func (column, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (bottom_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), bottom_right_tree_view);
gtk_box_pack_start (GTK_BOX (vbox2), swindow, TRUE, TRUE, 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