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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:30:34+00:00 2026-06-16T14:30:34+00:00

I have very strange problem with gtk.Image(). Simple question; how to update image? On

  • 0

I have very strange problem with gtk.Image(). Simple question; how to update image?
On window creation I create image and pack it… On that time I load image from disk. Now I start downloading image from url, and when it’s done I just want to replace existing image with new one. I rewrite content of same file on disk and then do:

    pixbuf = gtk.gdk.pixbuf_new_from_file(image_path)
    self._user_avatar.set_from_pixbuf(pixbuf)

I have tried
self._user_avatar.set_from_file(image_path)
and
self._user_avatar.clear()
nothing works. When i restart app there is a new image and everything is ok.

  • 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-16T14:30:35+00:00Added an answer on June 16, 2026 at 2:30 pm

    gtk.Image.set_from_pixbuf is the right method, so your problem may come from something else. Try on the most simple piece of code to reproduce your problem.

    Here’s a working sample:

    import pygtk
    pygtk.require('2.0')
    import gtk
    
    pics = []
    clicks = 0
    
    def on_destroy (widget):
        gtk.main_quit()
        return False
    
    def on_button_clicked (widget, image):
        global clicks
        clicks += 1
        image.set_from_pixbuf (pics[clicks % len(pics)])
    
    def create ():
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.connect("destroy", on_destroy)
    
        pics.append (gtk.gdk.pixbuf_new_from_file("sample1.png"))
        pics.append (gtk.gdk.pixbuf_new_from_file("sample2.png"))
    
        image = gtk.Image()
        image.set_from_pixbuf(pics[0])
    
        button = gtk.Button ("Switch Image")
        button.connect("clicked", on_button_clicked, image)
    
        vbox = gtk.VBox()
        vbox.pack_start (image)
        vbox.pack_start (button)
    
        window.add(vbox)
        window.show_all()
    
    if __name__ == "__main__":
        create()
        gtk.main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very simple situation... very strange problem. I have a retained iVar NSMutableArray that I
Im having a very strange problem, i have a complicated view that returns incorrect
I have a very strange memory leak problem, it seems that sqlite3_step is doing
I am having a very strange problem in a simple program and have been
I have very strange problem with Doxygen: I used it to create documentation from
I have very strange problem with mySQL and simple query with simple index. I
I have a very strange problem that I can't wrap my head around... I
I have a very strange problem. <table border =1> <tbody> <c:forEach var=question items=${questions}> <tr>
Very strange problem with my iPhone App. We have an App that has been
I have a very strange problem with #any? printing true for an array that

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.