Terseus schrieb:
> Sorry, I forgot to mention one thing, when I create a page in a 
> notebook widget and destroy it, if I try now to destroy a page with 
> the notebook empty the function ewl_notebook_visible_page_get still 
> give me a not NULL widget (the same offset of the previously destroyed 
> widget) which pass the "if( !widget )" check, I have add a check but 
> is redundant; now my code look like this:

Oh, indeed it looks like the current (saved) page isn't set to NULL or 
anything else. if the page is removed. That's not good. I'll hopefully 
take a look on it tomorrow.
>
>     if( !page_box )
>        return;
>
>     if( !EWL_WIDGET_IS( pagebox ) )
>        return;
>
>
> The first is necessary to avoid an EWL warning thant happen when 
> EWL_WIDGET_IS is called with a NULL pointer, the second for the 
> ewl_notebook_visible_page_get behavior, is this intentioned or a bug?
>

Right, EWL_WIDGET_IS() warns on NULL arguments. That's intentionally. 
But a test on EWL_WIDGET_IS() is always a sign of a bug, because all the 
EWL_*_IS() macros only work with widgets, if the give pointer is not a 
widget the result of the function is undefined. It may even segfault. So 
most probably, what you get from ewl_notebook_visible_page_get() is 
simply wrong.

Peter


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to