X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fdemo-Gtk.c;h=b2620a4f7ef12d17e8488a2a6b1afae377dea322;hb=96bdd7cf6ea60c418a76921acaf0e34d6f5be930;hp=a85bdbc020ea489d44321fb2634d803e9b74f677;hpb=40eacb5812ef7c0e3374fb139afbb4f5bc8bbfb5;p=xscreensaver diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c index a85bdbc0..b2620a4f 100644 --- a/driver/demo-Gtk.c +++ b/driver/demo-Gtk.c @@ -300,16 +300,14 @@ ensure_selected_item_visible (GtkWidget *widget) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); if (!gtk_tree_selection_get_selected (selection, &model, &iter)) - return; - - path = gtk_tree_model_get_path (model, &iter); + path = gtk_tree_path_new_first (); + else + path = gtk_tree_model_get_path (model, &iter); -# if 0 - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (widget), - path, NULL, FALSE, 0.0, 0.0); -# else gtk_tree_view_set_cursor (GTK_TREE_VIEW (widget), path, NULL, FALSE); -# endif + + gtk_tree_path_free (path); + #else /* !HAVE_GTK2 */ GtkScrolledWindow *scroller = 0; @@ -433,7 +431,8 @@ warning_dialog (GtkWidget *parent, const char *message, while (parent && !parent->window) parent = parent->parent; - if (!GTK_WIDGET (parent)->window) /* too early to pop up transient dialogs */ + if (!parent || + !GTK_WIDGET (parent)->window) /* too early to pop up transient dialogs */ { fprintf (stderr, "%s: too early for dialog?\n", progname); return; @@ -771,7 +770,6 @@ doc_menu_cb (GtkMenuItem *menuitem, gpointer user_data) sprintf (help_command + strlen(help_command), p->load_url_command, p->help_url, p->help_url); strcat (help_command, " ) &"); -fprintf(stderr, "## %s\n", help_command); system (help_command); free (help_command); }