LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   GtkImage problem with gtk_image_set_from_file (https://www.linuxquestions.org/questions/programming-9/gtkimage-problem-with-gtk_image_set_from_file-182485/)

Rajahuroman 05-17-2004 11:47 AM

GtkImage problem with gtk_image_set_from_file
 
Hello

I used gtk_image_set_from_file but the image looks hazy, like beeing fogged. I don't understand why. Can anyone help me?

rkef 05-17-2004 12:29 PM

I've only been using GTK for < one week, but I just use:
Code:

GtkWidget*  gtk_image_new_from_file        (const gchar *filename);
for creating image widgets, and I've had no problems at all. Try that; if you still have a problem, then it's something beyond what I could guess at.. maybe post or link us to the relevant code, so we can try it :).

Rajahuroman 05-19-2004 08:34 AM

The relevant code was
GtkWidget *pendul;
pendul=gtk_image_new_from_file("foucoultmic.jpg");
gtk_widget_show (pendul);
gtk_box_pack_start (GTK_BOX (hbox1), pendul, FALSE, FALSE, 3);
gtk_widget_set_size_request (pendul, 200, 316);
gtk_widget_set_sensitive (pendul, FALSE);

It is generated by Glade. I used it to speed up things in designing my interface. I commented the last line (gtk_widget_set_sensitive (pendul, FALSE);) and now everything seems to be allright. The image is displayed as it should. I don't really need any more help but I would be curious if somebody may tell me why gtk_widget_set_sensitive (pendul, FALSE); makes the image look like being sorounded by a fog. You can try it too. Just add gtk_widget_set_sensitive (/*your widget*/, FALSE);. Why does it scramble my image?

The_Nerd 05-19-2004 12:04 PM

That is what sensitive does. I think sensitive means you can't select it, or rather, its read only. You'll see text sometimes that is sensitive, or grayed, like unusable menu items. Ya! Thats it! For menu items, pretend a menu item "Save" has a Save Disk image to the side of it, now if it is grayed, or sensitive, then the Save Disk image would be fogged also!

Thats why.


All times are GMT -5. The time now is 04:59 AM.