GTK GtkImage Widget
I used Glade to design an interface and there I selected a GtkImage widget. also loaded an image there, using Glade. But when the program starts there is no image seen. Why? Must I load it at runtime as well as at design time? The tutorial at www.gnome.org isn't explicit enough. I tried using gtk_image_set_from_file() but it still doesn't load. I placed it in the on_window1_activate_default signal.
And another thing: Can you tell me some website where I can find all the signals and their time of response, a description of all GTK+ signals? |
Same problem also faced by me there is one good and temparary solutions for it.
In main.c file there is one line add_pixdirectory some thing..If u pass desire directory there then u will get images.. or it will search for default dir of /usr/share/pixmaps------something like this If u read Makefile then u can get that information ok |
Tank you, as soon as i'll get home, i'll try it. After almost 2 years I almost forgot I asked this question but I still couldn't find an answer. All of my GTK projects suffered from this little bug. Many, many thanks. If you ever come to Romania there's a beer for you in my account :)
|
GtkImage - glade
Hi, I'm fairly new with Glade 2.10.0, have taken it through some paces, delighted. Am still having problems getting any image to come up with GtkImage:scratch: I've tried making sure that a .jpg is available in the /myproject/pixmap directory, even tried .xpm and .png no good.
I tried working around it and simply having a GtkImage and setting the icon to a .jpg file, no go too (at least in that case the terminal window gave the file not found message. In all cases there seems to be a problem finding it. santhosh, I read your response of 11/05 but couldn't locate anything similar in main.c Anyone else had this problem? suggestions? I've spent probably three days in the tutorials and manuals but the solution won't come to me. thanks, John |
How are you loading the file... gdk_pixbuf_new_from_file()?
|
the window I want it to be in is named image1 as a GtkImage by Glade.
I have a separate button with a callback funcion which includes only this (hoping it will load and refresh image1) GtkImage *image1; gtk_image_set_from_file (image1,"mypic.jpg"); gtk_widget_show(image1); I get error: assertion GTK_IS_IMAGE(image) failed thanks, John |
Code:
GtkImage *image1; Code:
gxml = glade_xml_new ("whatever.glade", NULL, NULL); Code:
GtkWidget *image1; If you're still having problems, post more of you code so we can see what you're doing with your glade file. |
Micah, thanks for your help.
Your reference to gxml = glade_xml_new("whatever.glade"NULL,NULL); has me a bit confused and curious. I just went back and searched high and low, in main,interface,support,callbacks and makefile and couldn't find any reference to anyting xml except a reference in Makefile to dependency on various flavors of libxml. I've never seen reference to it in any turorials or glade docs although I assumed it was involved somehow waaay in the background. NO, PLEASE don't tell me I need to learn another language ;) A thought I had this afternoon while finally out walking was that I set up glade to run on C not C++ would this have any effect on what I am trying to do? John |
I appoligize... I though you were using libglade which is different than glade generating the C code. My bad. In any case, you still don't have image1 pointing to anything. Can you post your main.c file?
The code: Code:
GtkImage *image1; Alternately, you could use gtk_image_new_from_file instead, however, then you're not using the GtkImage you defined in the glade file but are instead creating a new one. Again, post your main.c and we'll let you know. - Micah |
All times are GMT -5. The time now is 03:32 AM. |