GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Nov 28, 2014 9:43 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: gtk_image_set_from_file not working sometimes
PostPosted: Tue Apr 29, 2008 1:59 pm 
Offline

Joined: Tue Apr 29, 2008 1:16 pm
Posts: 2
Hi All,

I am using the following function to set the image to a Widget
gtk_image_set_from_file();
Sometimes this function is updating the image but sometimes it is not at all displaying the image but still it is not crashing i.e. (rest of the code flow is working fine). Any idea on this will help.

Thanks in advance.
Vamsee.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 2:12 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
From the API...

Quote:
Creates a new GtkImage displaying the file filename. If the file isn't found or can't be loaded, the resulting GtkImage will display a "broken image" icon. This function never returns NULL, it always returns a valid GtkImage widget.

If you need to detect failures to load the file, use gdk_pixbuf_new_from_file() to load the file yourself, then create the GtkImage from the pixbuf. (Or for animations, use gdk_pixbuf_animation_new_from_file()).

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2008 5:05 am 
Offline

Joined: Tue Apr 29, 2008 1:16 pm
Posts: 2
Thanks for the information

I am getting the image on the widget. Now I am trying for upon clicking one button I need to change the other buttons image for this i am facing the same problem.

Thnaks,
Vamsee


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group