summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-02-26 19:37:29 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-02-26 19:37:29 +0000
commita3cf1957cb5b9621fc4a20098362f488966400ee (patch)
treed1914b36373aade608154c80d00e652b00dafd4f
parentf10c733cb9f6c9b757edd47a913040446255af60 (diff)
downloadgdk-pixbuf-a3cf1957cb5b9621fc4a20098362f488966400ee.tar.gz
Do the setting of tree->root_tree in parent_set rather than _map(), fixing
Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtktree.c (gtk_tree_class_init): Do the setting of tree->root_tree in parent_set rather than _map(), fixing #50892 in a bit better manner.
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLog.pre-2-012
-rw-r--r--ChangeLog.pre-2-1012
-rw-r--r--ChangeLog.pre-2-212
-rw-r--r--ChangeLog.pre-2-412
-rw-r--r--ChangeLog.pre-2-612
-rw-r--r--ChangeLog.pre-2-812
-rw-r--r--gtk/gtktree.c83
8 files changed, 148 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index d7f697dd0..30396f563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index d7f697dd0..30396f563 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,15 @@
+Fri Feb 23 15:06:48 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktree.c (gtk_tree_class_init): Do the setting
+ of tree->root_tree in parent_set rather than _map(),
+ fixing #50892 in a bit better manner.
+
+Fri Feb 23 11:54:25 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtklistitem.c (gtk_list_item_focus_out): Emit
+ "end_selection", since we won't get subsequent key
+ releases. (#13447)
+
Thu Feb 22 20:50:08 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
diff --git a/gtk/gtktree.c b/gtk/gtktree.c
index ccaec4851..b024b0fa3 100644
--- a/gtk/gtktree.c
+++ b/gtk/gtktree.c
@@ -41,6 +41,8 @@ static void gtk_tree_class_init (GtkTreeClass *klass);
static void gtk_tree_init (GtkTree *tree);
static void gtk_tree_destroy (GtkObject *object);
static void gtk_tree_map (GtkWidget *widget);
+static void gtk_tree_parent_set (GtkWidget *widget,
+ GtkWidget *previous_parent);
static void gtk_tree_unmap (GtkWidget *widget);
static void gtk_tree_realize (GtkWidget *widget);
static void gtk_tree_draw (GtkWidget *widget,
@@ -142,6 +144,7 @@ gtk_tree_class_init (GtkTreeClass *class)
widget_class->map = gtk_tree_map;
widget_class->unmap = gtk_tree_unmap;
+ widget_class->parent_set = gtk_tree_parent_set;
widget_class->realize = gtk_tree_realize;
widget_class->draw = gtk_tree_draw;
widget_class->expose_event = gtk_tree_expose;
@@ -172,7 +175,7 @@ static void
gtk_tree_init (GtkTree *tree)
{
tree->children = NULL;
- tree->root_tree = NULL;
+ tree->root_tree = tree;
tree->selection = NULL;
tree->tree_owner = NULL;
tree->selection_mode = GTK_SELECTION_SINGLE;
@@ -542,21 +545,44 @@ gtk_tree_forall (GtkContainer *container,
}
static void
-gtk_tree_map (GtkWidget *widget)
+gtk_tree_unselect_all (GtkTree *tree)
{
- GtkTree *tree;
+ GList *tmp_list, *selection;
+ GtkWidget *tmp_item;
+
+ selection = tree->selection;
+ tree->selection = NULL;
+
+ tmp_list = selection;
+ while (tmp_list)
+ {
+ tmp_item = selection->data;
+
+ if (tmp_item->parent &&
+ GTK_IS_TREE (tmp_item->parent) &&
+ GTK_TREE (tmp_item->parent)->root_tree == tree)
+ gtk_tree_item_deselect (GTK_TREE_ITEM (tmp_item));
+
+ gtk_widget_unref (tmp_item);
+
+ tmp_list = tmp_list->next;
+ }
+
+ g_list_free (selection);
+}
+
+static void
+gtk_tree_parent_set (GtkWidget *widget,
+ GtkWidget *previous_parent)
+{
+ GtkTree *tree = GTK_TREE (widget);
GtkWidget *child;
GList *children;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_TREE (widget));
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
- tree = GTK_TREE (widget);
-
- if(GTK_IS_TREE(widget->parent))
+ if (widget->parent && GTK_IS_TREE (widget->parent))
{
+ gtk_tree_unselect_all (tree);
+
/* set root tree for this tree */
tree->root_tree = GTK_TREE(widget->parent)->root_tree;
@@ -566,9 +592,34 @@ gtk_tree_map (GtkWidget *widget)
tree->indent_value;
tree->view_mode = GTK_TREE(GTK_WIDGET(tree)->parent)->view_mode;
tree->view_line = GTK_TREE(GTK_WIDGET(tree)->parent)->view_line;
- }
+ }
else
- tree->root_tree = tree;
+ {
+ tree->root_tree = tree;
+
+ tree->level = 0;
+ tree->current_indent = 0;
+ }
+
+ children = tree->children;
+ while (children)
+ {
+ child = children->data;
+ children = children->next;
+
+ if (GTK_TREE_ITEM (child)->subtree)
+ gtk_tree_parent_set (GTK_TREE_ITEM (child)->subtree, child);
+ }
+}
+
+static void
+gtk_tree_map (GtkWidget *widget)
+{
+ GtkTree *tree = GTK_TREE (widget);
+ GtkWidget *child;
+ GList *children;
+
+ GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
children = tree->children;
while (children)
@@ -1058,12 +1109,6 @@ gtk_real_tree_select_child (GtkTree *tree,
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_TREE_ITEM (child));
- if (!tree->root_tree)
- {
- g_warning ("gtk_real_tree_select_child(): unable to select a child in a tree prior to realization");
- return;
- }
-
root_selection = tree->root_tree->selection;
switch (tree->root_tree->selection_mode)