wxDataViewListCtrl - funny behaviour Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
boydale1
Knows some wx things
Knows some wx things
Posts: 37
Joined: Sat Jun 12, 2010 6:24 pm
Contact:

wxDataViewListCtrl - funny behaviour

Post by boydale1 » Mon Aug 09, 2010 8:40 pm

I have been messing with the wxDataViewListCtrl and I tried to delete all the items in the listctrl and then repopulate the list with new data, and when I do wxDataViewListCtrl::DeleteAllItems() I get a crash unless I also do wxDataViewListCtrl::GetStore()::DeleteAllItems().

I am going to try and find an easy way to recreate this, but until then here is a snippet of what I have.

Code: Select all

    mGIDList->DeleteAllItems( );
    mGIDList->GetStore()->DeleteAllItems(); //WITHOUT THIS IT CRASHES WHEN I SCROLL THE LIST
    wxVector<wxVariant> data;
    for( int i = 1; i <= (event.GetSelection()+1); i++)
    {
        data.clear();
        data.push_back(wxVariant(wxString::Format(wxT("GID #%i"), i) ) );
        data.push_back(wxVariant(1) );
        mGIDList->AppendItem( data );
    }

boydale1
Knows some wx things
Knows some wx things
Posts: 37
Joined: Sat Jun 12, 2010 6:24 pm
Contact:

Post by boydale1 » Mon Aug 09, 2010 8:43 pm

Also, I just noticed that if you go to dataview example and go to the last tabe wxDataViewTreeCtrl and press delete all the program crashes.

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Tue Aug 10, 2010 6:27 am

The standard response to these problems is, take the minimal wxWidgets sample and add your wxDataViewTreeCtrl code there. Then add a button that demonstrates the "bug" and file a patch to the wxWidgets bug tracker. This is the most easy way to get a bug fixed and proven.

The reason why you should use the minimal sample is that you exclude possibilities that maybe some other parts of your application cause heap / stack corruption and great way to isolate the problem.

With regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

boydale1
Knows some wx things
Knows some wx things
Posts: 37
Joined: Sat Jun 12, 2010 6:24 pm
Contact:

Post by boydale1 » Tue Aug 10, 2010 1:58 pm

I posted a ticket for this.

Usually I just assume that I am doing something wrong, but I guess this wasn't my fault.

Thanks!

Post Reply