DataViewCtrl.GetModel not returning PyDataViewModel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DataViewCtrl.GetModel not returning PyDataViewModel

Christian K
I am having trouble to figure out how to get a reference to the selected
object of a DataViewCtrl. GetSelection() returns a DataViewItem which can be
processed by PyDataViewModel.ItemToObject to get the actual object.
Unfortunately DataViewCtrl.GetModel returns a DataViewModel instance which
lacks ItemToObject instead of PyDataViewModel. Is this a bug? How am I supposed to get a reference to
the object without being obliged to store a reference to the model myself?

Thanks, Christian

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: DataViewCtrl.GetModel not returning PyDataViewModel

Chris Norman
No idea… If I understand your questions correctly, I’ve been wondering the same stuff. I have frame.results which is the table, and then frame._results which is a pure list of the data I chuck into frame.results. Probably not the healthiest way of doing things, but it works.

Cheers,


Take care,
Chris Norman



On 13 May 2015, at 21:15, Christian K <[hidden email]> wrote:

I am having trouble to figure out how to get a reference to the selected
object of a DataViewCtrl. GetSelection() returns a DataViewItem which can be
processed by PyDataViewModel.ItemToObject to get the actual object.
Unfortunately DataViewCtrl.GetModel returns a DataViewModel instance which
lacks ItemToObject instead of PyDataViewModel. Is this a bug? How am I supposed to get a reference to
the object without being obliged to store a reference to the model myself?

Thanks, Christian

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.