On Sun, Sep 23, 2012 at 11:17 AM, Victor Bombi <son...@telefonica.net> wrote:
> I have found one of the asserts I get with 2.9.4:
>
> I am using
>
> local ind=0
> while true do
>         local item=sizer:GetItem(ind)
>         if item==wx.wxNULL then break end
>         ...
> end
>
> but when sizer has not items I get the assertion from sizer.cpp
> wxSizerItem* wxSizer::GetItem( size_t index )
> {
>     wxCHECK_MSG( index < m_children.GetCount(),
>                  NULL,
>                  wxT("GetItem index is out of range") );
>
>     return m_children.Item( index )->GetData();
> }
>
> As I cant acces m_children whith GetChildren (was possible in 2.8.12) I can

It is added to SVN now.

> avoid the assertion for an empty sizer.
> I can only set DEBUG_FLAG=0 at building wxWidgets to avoid all assertions
> (docs say it avoids assertions but not the check_msg
> which is also done but outputs nothing??!!)

That is NEVER the right thing to do. C/C++ is not forgiving to people
who try to use invalid pointers. Please do not attempt to defeat
having your programming errors shown to you so you can fix them.

In any case, perhaps you could use one of the other accessors, but it
all depends on what you want to do with the sizer.

Regards,
    John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to