GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gtk_image_set_from_file not working sometimes

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
p_vamseekrishna



Joined: 29 Apr 2008
Posts: 2

PostPosted: Tue Apr 29, 2008 1:59 pm    Post subject: gtk_image_set_from_file not working sometimes Reply with quote

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.
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 407
Location: Portland, OR USA

PostPosted: Tue Apr 29, 2008 2:12 pm    Post subject: Reply with quote

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()).
Back to top
p_vamseekrishna



Joined: 29 Apr 2008
Posts: 2

PostPosted: Wed Apr 30, 2008 5:05 am    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP