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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:51:30+00:00 2026-06-11T17:51:30+00:00

I’m trying to call Gtk3’s GtkTreeRowReference() function without any success. I’m trying to delete

  • 0

I’m trying to call Gtk3’s GtkTreeRowReference() function without any success. I’m trying to delete multiple records from a ListStore using the associated TreeView’s selection set to MULTIPLE mode. I want to save a TreeRowReference for each ListStore item pointed to in the selection and use those to delete the ListStore items because those paths are supposed to get updated as ListStore items reached earlier in the selection get deleted. I’ve found many references to using TreeRowReferences in PyGtk 2 and the tutorial for PyGObject refers to their use but gives no actual example. I’ve tried many ways to invoke GtkTreeRowReference() without success. For example:

hit_rows = []
for row in range(len(self.selection.get_selected_rows()):
    hit = self.selection.get_selected_rows()[row]
    hit_row = Gtk.TreeRowReference(liststore, hit)
    hit_rows.append(hit_row)

produces this fatal error message: "TypeError: function takes at most 0 arguments (2 given)" when my program hits the Gtk.TreeRowReference line. The rows in the selection already contain a reference to the ListStore, so tried again with only the selection row as an argument, but that just got the complaint that the function still insists on 0 arguments and I had tried to pass it 1 argument.

I also tried things like this:

hit_rows = []
for row in range(len(self.selection.get_selected_rows())):
    hit = self.selection.get_selected_rows()[row]
    hit_row = hit.GtkTreeRowReference()
    hit_rows.append(hit_row)

These efforts provoked Python to complain about an "AttributeError: 'ListStore' object has no attribute 'GtkTreeRowReference'." Varying the invocation to TreeRowReference, Gtk_TreeRowReference and several other variations produced the same error message.

Can anyone spare me a clue about how to use Gtk.TreeRowReference in PyGObject/Gtk3? As a relatively new and inexperienced Python programmer who’s also new to Gtk, no doubt I’ve overlooked something breathtakingly obvious, but I’m stumped even after much internet searching.

  • 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-11T17:51:32+00:00Added an answer on June 11, 2026 at 5:51 pm

    Instead of just calling Gtk.TreeRowReference now (PyGObject + GTK+ 3) you have to use Gtk.TreeRowReference.new. For instance, you could use:

    selection = treeview.get_selection()
    model, paths = selection.get_selected_rows()
    refs = []
    for path in paths:
        refs.append(Gtk.TreeRowReference.new(model, path))
    

    That is, treeview has been defined before. Then, you can double check it later with something like:

    for ref in refs:
        path = ref.get_path()
        iter = model.get_iter(path)
        value = model.get(iter, 0)[0]
        print '(%s, %s)' % (path, value)
    

    In the last part, I assume you want to get the value of the first column in the model.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the

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.