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()


On Fri, 2004-07-30 at 13:59, David Jee wrote:
> Hello,
> 
> I committed the following patch to the java-gui-branch.  It implements
> GtkFramePeer.setIconImage().

Oops. That patch has a bug in it.  This one fixes it.

-David Jee

2004-07-30  David Jee  <djee@redhat.com>

        * gnu/java/awt/peer/gtk/GtkFramePeer.java
        (setIconImage): Check if image is null.


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 ()

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