Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8251747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:20:17+00:00 2026-06-08T00:20:17+00:00

I have an application ( sscce code that works here ) with a GtkTreeView

  • 0

I have an application (sscce code that works here) with a GtkTreeView. Every time a line is selectd, a callback is invoked. This callback should retrieve the selected row and process its data someway.

My application has to select some lines of this tree view itself sometimes:

// Selecting a line
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, "0");
GtkTreeSelection *selection =
        gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
gtk_tree_selection_select_iter(selection, &iter);

This works well when I have to select a toplevel line, that is, a line that descends directly from the root. However, if I try to select a child line (e.g. the first child line from the third line) I got an error at the callback function (sscce code here, only change at line 42):

// Selecting a line
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, "2:0");
GtkTreeSelection *selection =
        gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
gtk_tree_selection_select_iter(selection, &iter);

The error is the following warning followed by a segfault:

(treetest:1843): Gtk-CRITICAL **: gtk_tree_store_get_path: assertion `iter->user_data != NULL’ failed

(treetest:1843): Gtk-CRITICAL **: IA__gtk_tree_model_get_string_from_iter: assertion `path != NULL’ failed

Also, this error never happens when I select the same line with the mouse.

How could it be? The selected path "2:0" is valid, but the iter returned from the selection is not, so I presume the row is not being selected. Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:20:18+00:00Added an answer on June 8, 2026 at 12:20 am

    The problem is that the toplevel line is collapsed. Its children rows are hidden and so they cannot be selected.

    A solution is to progamatically expand the parent row before selecting one of its children (sscce code here):

    // Expanding
    GtkTreePath *path = gtk_tree_path_new_from_string("2");
    gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE);
    // Selecting a line
    gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, "2:0");
    GtkTreeSelection *selection =
            gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
    gtk_tree_selection_select_iter(selection, &iter);
    

    Of course, this error just happens when I select the line programatically because it is not possible to select a child of a collapsed row clicking on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have application that have button i want when click this button every 1
I have application that works using Perl's CGI::Fast . Basically mainloop of the code
I have application with needs to have access to some sensitive data(in this case
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
We have application that runs 24h per day and 7 days per week. Sometimes
I have application that uses IPv4 addresses (it stores them as long), so it
We have application that involves C++ socket server, Flash client that communicates with C++
I have application that produces files. I would like to connect those files with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.