The on_treeview2_cursor_changed() handler is connected to both the left and right tree views, but it hardcodes model2 (the GtkTreeModel of the right tree view). This is incorrect. Get the associated model from the view.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -678,13 +678,14 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget, · 677 unmodified lines | ||
| 678 | 678 | static void on_treeview2_cursor_changed(GtkTreeView *treeview, |
| 679 | 679 | gpointer user_data) |
| 680 | 680 | { |
| 681 | + GtkTreeModel *model = gtk_tree_view_get_model(treeview); | |
| 681 | 682 | GtkTreeSelection *selection; |
| 682 | 683 | GtkTreeIter iter; |
| 683 | 684 | struct menu *menu; |
| 684 | 685 | |
| 685 | 686 | selection = gtk_tree_view_get_selection(treeview); |
| 686 | − if (gtk_tree_selection_get_selected(selection, &model2, &iter)) { | |
| 687 | − gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); | |
| 687 | + if (gtk_tree_selection_get_selected(selection, &model, &iter)) { | |
| 688 | + gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1); | |
| 688 | 689 | text_insert_help(menu); |
| 689 | 690 | } |
| 690 | 691 | } |