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

  • Home
  • SEARCH
  • 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 4093610
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:38:23+00:00 2026-05-20T19:38:23+00:00

I am trying to code the following: Two Columns. One contains a itemId, the

  • 0

I am trying to code the following: Two Columns. One contains a itemId, the other one contains a typeId. I want to render the itemId only when the typeId equals a specific value.


class IDRenderer(gtk.CellRendererText):

  def __init__(self):
    gtk.CellRendererText.__init__(self)

  def do_render(self,window, widget, background_area, cell_area, expose_area, flags):
    if ----} Condition to ask for value of the typeId - Cell {-----:
      gtk.CellRendererText.do_render(self, window, widget, background_area, cell_area,    
                                     expose_area, flags)

gobject.type_register(IDRenderer)

I don’t know how to get the iter of the currently rendered row which i need to determine the value of the typeId. Is this even possible?

  • 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-05-20T19:38:23+00:00Added an answer on May 20, 2026 at 7:38 pm

    I now found out, thanks to a nice guy on #pygtk on gimpIRC:

    You can do that, with binding so called cell data functions to the corresponding gtk.TreeViewColumn as done here in this example

    def renderId(celllayout, cell, model, iter):
      if model.get_value(iter,1) == 3:
        cell.set_property('visible',True)
      else:
        cell.set_property('visible',False)
    
    treeviewcolumn = gtk.TreeViewColumn()
    renderer = gtk.CellRendererText()
    treeviewcolumn.add_attribute(renderer,'text',0)
    treeviewcolumn.set_cell_data_func(renderer,renderId)
    

    I ommited some code relevant to render a complete treeview, but i think it shows what i wanted to do and how to do it.

    The column renderes the value in the first column (0) of the model only if the value in the second modelcolumn (1) equals 3

    I hope this could help someone some time.

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

Sidebar

Related Questions

I am trying to understand how the following code ties into two other .java
I have the following code, I'm trying to get a table with 4 columns
I have the following code I am trying to consolidate. (here are two examples)
I'm trying to code the following HQL query using the Criteria API: var userList
I am trying the following code: <?php $link = mysql_connect('localhost', 'root', 'geheim'); if (!$link)
I'm trying to use the following code but it's returning the wrong day of
I'm trying to get the following code working: string url = String.Format(@SOMEURL); string user
I am trying to use the following code to write data into an excel
I am trying to use the following code, which I have not been able
I am trying to use the following code to export tables from access to

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.