Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_button.c 


Log Message:
- if a button receives a null image it will distroy the image set on the 
button. 
  fixes warning pointed out by Quan. Thanks.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_button.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- ewl_button.c        8 Sep 2006 02:44:45 -0000       1.38
+++ ewl_button.c        7 Oct 2006 02:11:44 -0000       1.39
@@ -194,9 +194,8 @@
                                ewl_stock_items[b->stock_type].image_key,
                                EWL_ICON_SIZE_MEDIUM);
 
-       if (data) 
-               ewl_button_image_set(b, data, 
-                    ewl_stock_items[b->stock_type].image_key);
+       ewl_button_image_set(b, data, 
+                ewl_stock_items[b->stock_type].image_key);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -228,8 +227,16 @@
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("b", b);
-       DCHECK_PARAM_PTR("file", file);
        DCHECK_TYPE("b", b, EWL_BUTTON_TYPE);
+
+       if (!file)
+       {
+               if (b->image_object)
+                       ewl_widget_destroy(b->image_object);
+               b->image_object = NULL;
+               
+               DRETURN(DLEVEL_STABLE);
+       }
 
        if (!b->image_object) {
                Ewl_Container *redir;



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to