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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:43:45+00:00 2026-05-15T08:43:45+00:00

i am having a issue with treeview liststore trying to get a real-time update,

  • 0

i am having a issue with treeview liststore trying to get a real-time update, and I created a example to simulate what I’d like to do.
I want liststore1 updated each loop.

http://img204.imageshack.us/i/capturadetela5.png/

it should update the treeview column ‘speed’ and give to it a different number every second,
something like a download manager.

import gtk
import gtk.glade
import random

builder = gtk.Builder()
builder.add_from_file('ttt.glade')
window = builder.get_object('window1')
treeview  = builder.get_object('treeview1')
store = builder.get_object('liststore1')
column_n = ['File','Size','Speed']
rendererText = gtk.CellRendererText()


for i in range(10):
    foo = random.randint(100,256)
    list_ =  [('arquivo1.tar.gz', '10MB', '%s k/s' % foo)]

for x,y in zip(column_n,range(3)):

    column = gtk.TreeViewColumn(x, rendererText, text=y)
    column.set_sort_column_id(0)    
    treeview.append_column(column)


for list_index in list_:
    store.append([list_index[0],list_index[1],list_index[2]])

window.show_all()
  • 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-15T08:43:45+00:00Added an answer on May 15, 2026 at 8:43 am

    If that’s your full code, you’re missing the GTK main loop invocation.

    You need to do two things (in this order)

    1 – Connect your window’s destroy signal to a function that calls gtk.main_quit()

    def on_destroy(widget, user_data=None):
        # Exit the app
        gtk.main_quit()
    
    window.connect('destroy', on_destroy)
    

    2 – Start the GTK main loop:

    gtk.main()
    

    This is where your app is effectively launched, and it will appear to hang at this line until gtk.main_quit() is called.

    More generally… you should clean up the code a bit there 🙂 Look at the “Hello World” demo from the PyGTK tutorial – it basically covers those points and more in greater detail. You’ll find that following their general structure for things helps immensely.

    If you want timed updates, look at the functions timeout_add and timeout_add_seconds – depending on your version of PyGTK/PyGobject these will be in the glib or gobject modules.

    (Incidentally, GTKBuilder XML files typically have the .ui extension, even though Glade doesn’t know it.)

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

Sidebar

Related Questions

I'm having an issue with my regex. I want to capture <% some stuff
I'm having an issue with the TreeView in Visual Studio 2008. I'm adding the
I having an issue with the ASP.NET Treeview control. I create the treeview just
So I am having an issue with the TreeView. If I build a tree
Having an issue, here is the problem. Created a branch from the trunk, made
I'm having an issue with a query that currently uses LEFT JOIN weblog_data AS
I'm having an issue with a Flash/Flex erroring in Firefox but not IE. I
I’m having an issue where a drop down list in IE 6/7 is behaving
I am having an issue where Tomcat is treating extra path information as part
I'm having an issue with a standard ASP.NET page that has a TextBox and

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.