wxTreeListCtrl - oversight in gixmos.i for GetSelections

Hi,

Just upgraded to 2.4.1 and noticed that he wxTreeListCtrl.GetSelections()
method hadn't been "pythonified" to return a list of tree ids instead of the
C way of passing in an wxArray to get filled up.

Following what's going on in controls2.i for wxTreeCtrl I think that
gizmos.i should be changed from:

line 722:
     size_t GetSelections(wxArrayTreeItemIds& selection);

to:

line 722:
    //size_t GetSelections(wxArrayTreeItemIds& selection);
    %addmethods {
        PyObject* GetSelections() {
            wxPyBeginBlockThreads();
            PyObject* rval = PyList_New(0);
            wxArrayTreeItemIds array;
            size_t num, x;
            num = self->GetSelections(array);
            for (x=0; x < num; x++) {
                wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
                PyObject* item = wxPyConstructObject((void*)tii,
wxT("wxTreeItemId"), TRUE);
                PyList_Append(rval, item);
            }
            wxPyEndBlockThreads();
            return rval;
        }
    }

It's basically a cut and paste of the wxTreeCtrl one anyway and it works on
my box.

Thoughts?

Muz

···

___________________________________________________
Murray Steele
Software Engineer
___________________________________________________
APR Smartlogik Limited.
160 Euston Road * London * NW1 2LZ
phone +44 (0)20 7961 3900
fax +44 (0)20 7961 3949
map: http://www.aprsmartlogik.com/contact/LocationMap.pdf

mailto:Murray.Steele@aprsmartlogik.com
http://www.aprsmartlogik.com/

***********************************************************************
This e-mail may contain proprietary and confidential
information and is intended for the recipient(s) only.
If an addressing or transmission error has misdirected this
e-mail, please notify the systems administrator by forwarding
this e-mail to mailto:postmaster@aprsmartlogik.com.
If you are not the intended recipient(s) disclosure, distribution,
copying or printing of this e-mail is strictly prohibited.
***********************************************************************

Murray Steele wrote:

Hi,

Just upgraded to 2.4.1 and noticed that he wxTreeListCtrl.GetSelections()
method hadn't been "pythonified" to return a list of tree ids instead of the
C way of passing in an wxArray to get filled up.

Thanks, I missed that one.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!