This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gui] [PATCH] Implement GtkFramePeer.setIconImage()


David Jee wrote:

Index: gnu/java/awt/peer/gtk/GtkFramePeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java,v
retrieving revision 1.17.2.2
diff -u -r1.17.2.2 GtkFramePeer.java
--- gnu/java/awt/peer/gtk/GtkFramePeer.java 30 Jul 2004 17:56:45 -0000 1.17.2.2
+++ gnu/java/awt/peer/gtk/GtkFramePeer.java 30 Jul 2004 18:28:27 -0000
@@ -149,9 +149,12 @@
native void nativeSetIconImage (GdkPixbufDecoder decoder);
public void setIconImage (Image image) {
- GtkImage img = (GtkImage) image;
- if (img.isLoaded() && img.getSource() instanceof GdkPixbufDecoder)
- nativeSetIconImage((GdkPixbufDecoder) img.getSource());
+ if (image != null)
+ {
+ GtkImage img = (GtkImage) image;
+ if (img.isLoaded() && img.getSource() instanceof GdkPixbufDecoder)
+ nativeSetIconImage((GdkPixbufDecoder) img.getSource());
+ }
}


public Graphics getGraphics ()



What happens if img.getSource() isn't a GdkPixbufDecoder, or if it isn't loaded yet? Please add a FIXME to suggest that these cases need to be handled later.


Thanks

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]