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

The Archive Base Latest Questions

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

I have a global set of values, e.g. [Foo, Bar, Baz, Quux] . Each

  • 0

I have a global set of values, e.g. ["Foo", "Bar", "Baz", "Quux"]. Each row in my TreeView represents an entity that can only deal with a subset of these values. For example, the first row might deal with "Foo" and "Bar", and the second, "Bar" and "Quux". I want a ComboBox column to allow each row to select one of the values it can deal with.

However, from the code I have now, the entire column can only have one model for the ComboBox:

crc = gtk.CellRendererCombo()
crc.set_property('model', fooValuesModel)
crc.set_property('text-column', 0)
crc.set_property('editable', True)
crc.set_property('has_entry', False)

cl = gtk.TreeViewColumn(ctitle, crc, text=i)
treeView.append_column(cl)

I have only one opportunity to set a model for the entire column. Is there any way to have different stores for each row, or to filter values somehow?

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

    There’s also another way to do this.

    See also:
    http://mail.gnome.org/archives/gtk-perl-list/2005-July/msg00065.html

    (It’s in perl, but shouldn’t be too difficult to convert to python)

    The secret being this:

    Say you have a TreeView using a TreeStore as its model. And one of the columns uses a combobox cell renderer which will get a ListStore model per row:

    1. You can put ListStores into TreeStore columns, in perl that would be a column of type Gtk2::ListStore. Of course you wouldn’t add a column to the TreeView displaying this directly. Instead:

    2. You can have the comboboxcell-column use that column from the Treeview as its ListStore when you add it to the treeview, using ‘insert_column_with_attributes’ and connecting the ‘model’ attribute to the ListStore column of the TreeStore.

    3. When you add a row to the treeview, just put a complete ListStore into the ListStore column of the TreeStore. You can then fill the per-row ListStore with whatever values you want.

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

Sidebar

Related Questions

I have a global event created and set/reset in a native C++ process that
I have set an array in my config file that I use global in
I have a custom security principal object which I set in the global.asax for
I'm having trouble with global variables in php. I have a $screen var set
In Actionscript you can have global variables like this: var number : Number =
Can Dynamic libraries have global, local and static variables in linux? If yes, then
If i have global variable in A.dll, that depends on global variable in B.dll
I have some global variables in a Python script. Some functions in that script
I have a global header and footer that has a Database connection and a
Assume, for whatever reason, that we have three inline scripts on a page. Each

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.