FLTK logo

Loading multiple image files

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Loading multiple image files Sanji Mar 14, 2008  
 
I am creating a slide show viewer of where a user can select multiple files to show.

I built the loader to take in all of the file names into an array and then the rest of the program will cycle through the list and load/destroy the images and show them.

But while going through I found that only one image location is being put into the whole list and I cannot figure out why.

Here is relevant code:

void cb_main_load_multi(Fl_Widget*,void*)
{
	Fl_File_Chooser choice(".", "*.jpg\t", Fl_File_Chooser::MULTI, "Select JPEG Files");
  	choice.show();
  	while(choice.shown())
		Fl::wait();
  	if(!choice.value())
	  	return;
  	if(list)
  	{
		for(int i = 0; i < frames_total; ++i)
			delete list[i];
      delete [] list;
  	}
  	frames_total = choice.count();
  	list = new const char*[frames_total];
	for(int i = 0; i < frames_total; i++)
      list[i] = new char[MAX_CHAR];
   for (int i = 0; i < frames_total; i++)
	{
   	list[i] = choice.value(i+1);
   }
}

is there anything specific that I did wrong?
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.