aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-20 00:57:03 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-20 00:57:03 +0800
commit6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a (patch)
tree679de6d91322a1bbead15fb032fb17dd4467f6db /lib
parentdc85f85488cc9cf4ef1c665ec624a4a48ba27d65 (diff)
downloadgsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar.gz
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar.bz2
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar.lz
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar.xz
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.tar.zst
gsoc2013-epiphany-6d760fb1a90ca7d2adbe2bfd68a87eb1388b284a.zip
Avoid warnings when there is no match
2003-02-19 Marco Pesenti Gritti <marco@it.gnome.org> * lib/widgets/ephy-autocompletion-window.c: (ephy_autocompletion_window_init_widgets), (hack_tree_view_move_selection): Avoid warnings when there is no match
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-autocompletion-window.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/widgets/ephy-autocompletion-window.c b/lib/widgets/ephy-autocompletion-window.c
index a974a6570..1bdf48130 100644
--- a/lib/widgets/ephy-autocompletion-window.c
+++ b/lib/widgets/ephy-autocompletion-window.c
@@ -222,6 +222,7 @@ ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
p->tree_view = GTK_TREE_VIEW (gtk_tree_view_new ());
gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (p->tree_view));
+ gtk_widget_realize (GTK_WIDGET (p->tree_view));
renderer = gtk_cell_renderer_text_new ();
p->col1 = gtk_tree_view_column_new ();
@@ -654,12 +655,15 @@ hack_tree_view_move_selection (GtkTreeView *tv, GtkTreeView *alternate, int dir)
model = gtk_tree_view_get_model (alternate);
c = gtk_tree_model_iter_n_children (model, NULL);
- gtk_tree_model_iter_nth_child (model, &iter, NULL, c - 1);
- p = gtk_tree_model_get_path (model, &iter);
- selection = gtk_tree_view_get_selection (alternate);
- gtk_tree_selection_select_path (selection, p);
- gtk_tree_view_scroll_to_cell (alternate, p, NULL, FALSE, 0, 0);
- gtk_tree_path_free (p);
+ if (c > 0)
+ {
+ gtk_tree_model_iter_nth_child (model, &iter, NULL, c - 1);
+ p = gtk_tree_model_get_path (model, &iter);
+ selection = gtk_tree_view_get_selection (alternate);
+ gtk_tree_selection_select_path (selection, p);
+ gtk_tree_view_scroll_to_cell (alternate, p, NULL, FALSE, 0, 0);
+ gtk_tree_path_free (p);
+ }
return alternate;
}
else if (gtk_tree_selection_count_selected_rows (ts) == 0)