]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/animate.cpp
docstrings
[wxWidgets.git] / src / gtk / animate.cpp
index a2e17e22aa537e458199520bad660382cec3a1be..7b3b798c00ae796e492ca4d4122cb1bb44d8e93b 100644 (file)
@@ -211,9 +211,9 @@ bool wxAnimationCtrl::Create( wxWindow *parent, wxWindowID id,
     m_parent->DoAddChild( this );
 
     PostCreation(size);
-    SetBestSize(size);
+    SetInitialSize(size);
 
-    if (anim != wxNullAnimation)
+    if (anim.IsOk())
         SetAnimation(anim);
 
     // init the timer used for animation
@@ -351,10 +351,17 @@ void wxAnimationCtrl::DisplayStaticImage()
     }
     else
     {
-        // even if not clearly documented, gdk_pixbuf_animation_get_static_image()
-        // always returns the first frame of the animation
-        gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget),
-                                    gdk_pixbuf_animation_get_static_image(m_anim));
+        if (m_anim)
+        {
+            // even if not clearly documented, gdk_pixbuf_animation_get_static_image()
+            // always returns the first frame of the animation
+            gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget),
+                                        gdk_pixbuf_animation_get_static_image(m_anim));
+        }
+        else
+        {
+            ClearToBackgroundColour();
+        }
     }
 }