From: Marcelo V. <mva...@ro...> - 2006-08-22 02:04:17
|
The code I've sent about adding Play/Next/Prev buttons had a bug for next/prev. The function bellow replaces the buggy one (in display_songs.c): void tm_select_next_row (gint Next0_Prev1) { if (track_treeview) { GtkTreePath *path; GdkRectangle rect; GtkTreeSelection *selection; gint delta; gtk_tree_view_get_cursor ( track_treeview, &path, NULL); if (path == NULL) return; gtk_tree_view_get_cell_area (track_treeview, path, NULL, &rect); if (path == NULL) return; if (Next0_Prev1) delta = -rect.height/2; else delta = rect.height + rect.height/2; gtk_tree_view_get_path_at_pos (track_treeview, 1, rect.y + delta , &path, NULL, NULL, NULL); if (path == NULL) return; /* deselect current rows */ selection = gtk_tree_view_get_selection (track_treeview); gtk_tree_selection_unselect_all(selection); gtk_tree_selection_select_path ( selection, path); gtk_tree_view_set_cursor ( track_treeview, path, NULL, FALSE ); gtk_tree_path_free (path); } } Please note that those buttons are different then the ones I have proposed today to control the player. Those here are about the email I 've sent with a screenshot plus the related source code attached. Please test it. It seems OK to me to submit. Cheers, Marcelo |