caught uncaught Gdk exception;

added missing images
This commit is contained in:
fgerlits 2005-06-24 18:01:25 +00:00
parent 67ff8fbd13
commit 9aebbbb938
12 changed files with 15 additions and 5 deletions

View file

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.16 $
Author : $Author: fgerlits $
Version : $Revision: 1.17 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/TestWindow.cxx,v $
------------------------------------------------------------------------------*/
@ -33,6 +33,7 @@
#include "configure.h"
#endif
#include <iostream>
#include <gtkmm/main.h>
#include "LiveSupport/Widgets/WidgetFactory.h"

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.27 $
Version : $Revision: 1.28 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $
------------------------------------------------------------------------------*/
@ -406,8 +406,17 @@ WidgetFactory :: loadImage(const std::string imageName)
{
Glib::RefPtr<Gdk::Pixbuf> image;
if (!(image = Gdk::Pixbuf::create_from_file(path + imageName))) {
throw std::invalid_argument("Missing " + image);
bool success = true;
try {
image = Gdk::Pixbuf::create_from_file(path + imageName);
} catch (Glib::FileError &e) {
success = false;
} catch (Gdk::PixbufError &e) {
success = false;
}
if (!success || !image) {
throw std::invalid_argument("Missing " + imageName);
}
return image;

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB