GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Apr 20, 2014 10:53 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Open several images and display them without deleting old on
PostPosted: Wed Sep 05, 2012 5:39 pm 
Offline
Familiar Face

Joined: Mon Feb 27, 2012 9:56 pm
Posts: 7
I'm writing a program in C which needs to open several images multiple times. But I need all the images to remain displayed. So I do this:

This is within a for that loops in the number of images I open each time

Quote:
imagen = GTK_IMAGE(gtk_image_new_from_file(MagickGetImageFilename(image_wand)));
gtk_box_pack_end(GTK_BOX(caja_h),GTK_WIDGET(imagen),FALSE,FALSE,1);

gtk_box_pack_end(GTK_BOX(caja_v),caja_h,FALSE,FALSE,1);
caja_h = gtk_hbox_new (TRUE, 0);


The first time I open the images everything works fine but I need to be able to open several groups of images and display them. The second time I open another group of images the first image in the ones already displayed dissapears and only the first one of the second group I opened shows up.

Does someone has any tip on how to do that?


Top
 Profile  
 
 Post subject: Re: Open several images and display them without deleting ol
PostPosted: Fri Sep 07, 2012 12:48 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
I'm sorry but you really need to post more code for us to be able to tell what happens. When you load an image it does not destroy old ones by default, so the question is not how to do it without deleting but rather why is your code deleting it in the first place (and that cannot be seen from what you have provided -- only guessed at -- possibly because you are overwriting pointers).
Please post more code.


Top
 Profile  
 
 Post subject: Re: Open several images and display them without deleting ol
PostPosted: Fri Sep 07, 2012 3:59 pm 
Offline
Familiar Face

Joined: Mon Feb 27, 2012 9:56 pm
Posts: 7
Ok, that gave me some tips. Yeah I was deleting before the for loop!

Code:
  if(imagen != NULL)
  gtk_image_clear(imagen);


Thanks a lot I think that fixed the problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group