selecting and displaying from combobox in C




hi...am new to gtk+ and i want to display 2 images in 2 different image
widgets when a specific item is clicked from a combobox....i`ve managed to
display only one picture but i still dont know how to display a selected
item...the image is displayed by default when i use the following code:

void
on_cbo_itemdesign_changed              (GtkComboBox     *combobox,
                                        gpointer         user_data)
{ 
        
GtkWidget *image;

 image = lookup_widget(GTK_WIDGET(combobox), "img_objectdesign");
 gtk_image_set_from_file (GTK_IMAGE(image), "Pictures/baby.jpg");

}


now i want to assign the image (baby.jpg) to one of the items from the
combobox...but i dont know how to do that...if anyone can help me plz??

secondly i tried to display another image from the same signal but i dont
know how to do it as well...i`ve tried the following code but nothing is
displayed:

void
on_cbo_itemdesign_changed              (GtkComboBox     *combobox,
                                        gpointer         user_data)
{ 
        GtkWidget *image1;
        GtkWidget *image;
//for first image
 image = lookup_widget(GTK_WIDGET(combobox), "img_objectdesign");
 gtk_image_set_from_file (GTK_IMAGE(image), "Pictures/baby.jpg");
 
 //for second image
 image1 = lookup_widget(GTK_WIDGET(combobox), " img_patterndesign");
gtk_image_set_from_file(GTK_IMAGE(image1), "Pictures/myPattern.gif"); 

}

i would be much grateful if someone can place the missing code or send me
the code with a little explanation just to have an idea...

any help would be very appreciated........thanks
 
-- 
View this message in context: 
http://www.nabble.com/selecting-and-displaying-from-combobox-in-C-tf3364198.html#a9359856
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]