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

Bryce McKinlay mckinlay@redhat.com
Mon Aug 2 14:43:00 GMT 2004


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



More information about the Java-patches mailing list