Show menu items before adding to option menu.

Mon Jan  8 14:06:29 2001  Jonathan Blandford  <jrb@redhat.com>

	* tests/testtreeview.c (main): Show menu items before adding to
	option menu.

	* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
	around if we kill them.

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
	Return if we pass in a NULL model.
This commit is contained in:
Jonathan Blandford 2001-01-08 19:07:51 +00:00 committed by Jonathan Blandford
parent 157cfa27ca
commit 15b23123f7
10 changed files with 92 additions and 8 deletions

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -1,3 +1,14 @@
Mon Jan 8 14:06:29 2001 Jonathan Blandford <jrb@redhat.com>
* tests/testtreeview.c (main): Show menu items before adding to
option menu.
* gtk/gtktreeview.c (gtk_tree_view_set_model): Keep the columns
around if we kill them.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_cell_data):
Return if we pass in a NULL model.
2001-01-08 Havoc Pennington <hp@redhat.com>
* tests/testtreeview.c: hack on this some

View File

@ -2729,8 +2729,9 @@ _gtk_tree_view_set_size (GtkTreeView *tree_view,
if (tree_view->priv->model == NULL)
{
tree_view->priv->width = 1;
tree_view->priv->height = 1;
tree_view->priv->width = width;
tree_view->priv->height = height;
gtk_widget_queue_draw (GTK_WIDGET (tree_view));
return;
}
if (width == -1)
@ -2942,6 +2943,9 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
if (tree_view->priv->model != NULL)
{
/* No longer do this. */
#if 0
for (list = tree_view->priv->columns; list; list = list->next)
{
column = list->data;
@ -2952,6 +2956,7 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
gdk_window_destroy (column->window);
}
}
#endif
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_MODEL_SETUP))
{
gtk_signal_disconnect_by_func (GTK_OBJECT (tree_view->priv->model),
@ -2968,9 +2973,10 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
tree_view);
_gtk_rbtree_free (tree_view->priv->tree);
}
#if 0
g_list_free (tree_view->priv->columns);
tree_view->priv->columns = NULL;
#endif
GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_MODEL_SETUP);
}
@ -2978,8 +2984,6 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
if (model == NULL)
{
tree_view->priv->tree = NULL;
tree_view->priv->n_columns = 0;
tree_view->priv->columns = NULL;
if (GTK_WIDGET_REALIZED (tree_view))
_gtk_tree_view_set_size (tree_view, 0, 0);
return;

View File

@ -322,6 +322,9 @@ gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column,
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (tree_column->cell != NULL);
if (tree_model == NULL)
return;
if (tree_column->func && (* tree_column->func) (tree_column,
tree_model,
iter,

View File

@ -7,8 +7,8 @@ static GtkWidget* create_prop_editor (GObject *object);
/* This custom model is to test custom model use. */
#define GTK_TYPE_MODEL_TYPES (gtk_tree_model_types_get_type ())
#define GTK_TREE_MODEL_TYPES(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypes))
#define GTK_TREE_MODEL_TYPES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypesClass))
#define GTK_TREE_MODEL_TYPES(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypes))
#define GTK_TREE_MODEL_TYPES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypesClass))
#define GTK_IS_TREE_MODEL_TYPES(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_TYPES))
#define GTK_IS_TREE_MODEL_TYPES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_MODEL_TYPES))
@ -245,7 +245,7 @@ main (int argc,
++i;
}
gtk_widget_show_all (menu);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);