On Wed, Mar 07, 2007 at 05:50:44AM -0800, lucks wrote:
> 
> when i use this:
> 
> {
>   GtkWidget *image = lookup_widget(GTK_WIDGET(combobox),
> "img_objectdesign");
> 
>    gtk_image_set_from_file (GTK_IMAGE(image), "Pictures/baby.jpg");
> }
> 
> it works...as you can see image is already declared in the first line. that
> is GtkWidget *image=lookup...etc.

Where is variable `image1' declared there?

> if i declare it at top like GtkWidget *image; there is an error saying
> redefinition...so this doesnt solve the poblem..plz help

If you *only* moved the declaration + definition of image1
to the start of the block, it would work.  You could also
use only one image variable and always assign to it (assign,
no redeclaration):

  GtkWidget *image;

  image = lookup_widget...
  gtk_image_set_from_file...
  image = lookup_another_widget...
  gtk_image_set_from_another_file...

Please consult your C guide as this all is completely
unrelated to Gtk+, declaring variables is just elementary C.

Yeti

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to