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 8229695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:53:06+00:00 2026-06-07T16:53:06+00:00

In my application, I have a GtkIconView with single selection mode. I want to

  • 0

In my application, I have a GtkIconView with single selection mode. I want to get the text of the selected item (and act upon that further down the line). Right now, I have some code that I thin will work, however the actual getting of the GtkTreePath crashes the program (segfault).

Program received signal SIGSEGV, Segmentation fault.
0x0804d350 in minkovsky_ufilter_ufilter_window_on_filter_selected (
    e=0x8172010, self=0x8354d80)
    at /home/filip/ufilter/src/UfilterWindow.vala:281
281               TreePath item = filterchooser.get_selected_items().data;

Can you please tell me why it’s happening (and how to fix it)?

Thanks.

Edit: I made some more tests, but they are still inconclusive. Namely, I wanted to check if get_selected_items() returned null (causing the problem), but it just segfaulted again in the new place. This is the code:

    [CCode (instance_pos = -1)]
    public void on_filter_selected (Event e) {

        if(filterchooser.get_selected_items() == null){ // <-- Now happens here
            stderr.printf("Null!");
            return;
        }

        TreePath item = filterchooser.get_selected_items().data; // <-- Used to happen here
        TreeIter iter;
        string selection;
        filterchooser_liststore.get_iter(out iter, item);
        filterchooser_liststore.get(iter, 0, out selection);
        stderr.printf("Selected filter: %s\n", selection);
    }

Edit 2: Here’s the stripped-down version. It contains: Two source files, one glade file, and sample images, and a readme file with the compile command. You will need Valac v0.16, GTK+ 3.0 and GModule 2.0 (I could have stripped it further down, but it would just be missing the point: these will be needed in production code). Still segfaults.

  • 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-07T16:53:08+00:00Added an answer on June 7, 2026 at 4:53 pm

    The problem is that your signature for on_filter_selected doesn’t match the signal it is connected to (GtkIconView::item-activated, or Gtk.IconView.item_activated if you prefer Valadoc). You have

    public void on_filter_selected (Event e) ...
    

    but it should be something like this

    public void on_filter_selected (Gtk.IconView view, Gtk.TreePath path) {
      Gtk.TreeIter iter;
      string selection;
    
      GLib.return_if_fail (filterchooser_liststore.get_iter (out iter, path));
      filterchooser_liststore.get (iter, 1, out selection);
      GLib.stderr.printf ("Selected filter: %s\n", selection);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get all emails in my ASP.NET application that have a certain
In My application have time consuming process.There fore i try to do that operation
I have a WinForms application. That application have a rich functionality. It can create
My application have a configuration xml-file. That file contains more than 50 program settings.
My application have three pages (three tabs) and I want to switch beetween two
I have a Delphi application that communicates with web servers on the Internet using
My problem is that my application have around 12-13 screen, and all of that
My application have Linear Layouts. how to scroll up the selected Linear Layout? it
Our application have several EARs deployed to a single JBOSS-AS. Every EAR uses SLF4J
I have PHP application that contain three small applications. Each application have own users

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.