Hi,
On 05/03/2014 16:12, dario...@gmail.com wrote:
I’m trying to compute the DataViewItem that is under the mouse cursor:
in ListCtrl that is done through the HitTest method, but the
corresponding method for DataViewCtrl seems to behave differently, and
I haven’t understood how to use it. The following script, using a
DataViewListCtrl, is as far as I’ve managed to get, can anybody help
me? Thank you.
I gave it a shot and with 2.9.5 I get this exception:
File “h:\devProjectsT\aaTests\aaMisc\dariogiova\dvchitest.py”, line 26,
in
app.MainLoop()
File “c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx_core.py”, line
8660, in MainLoop
wx.PyApp.MainLoop(self)
File “c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx_core.py”, line
7952, in MainLoop
return core.PyApp_MainLoop(*args, **kwargs)
File “c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx_misc.py”, line
1367, in Notify
self.notify()
File “c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx_core.py”, line
16870, in Notify
self.result = self.callable(*self.args, **self.kwargs)
File “h:\devProjectsT\aaTests\aaMisc\dariogiova\dvchitest.py”, line 12,
in test
print(view.HitTest(pos, item, col))
File “c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\dataview.py”, line
1817, in HitTest
return _dataview.DataViewCtrl_HitTest(*args, **kwargs)
TypeError: in method ‘DataViewCtrl_HitTest’, expected argument 4 of type
‘wxDataViewColumn *&’
even though ‘col’ at that time is an instance of 'wx.dataview.DataViewColumn
If I run it against Phoenix (3.0.1.dev75864) I get:
File “h:\devProjectsT\aaTests\aaMisc\dariogiova\dvchitest.py”, line 28,
in
app.MainLoop()
File “c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\core.py”,
line 1878, in MainLoop
rv = wx.PyApp.MainLoop(self)
File “c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\core.py”,
line 1940, in Notify
self.notify()
File “c:\Python27\Lib\site-packages\wx-3.0.1-msw-phoenix\wx\core.py”,
line 3017, in Notify
self.result = self.callable(*self.args, **self.kwargs)
File “h:\devProjectsT\aaTests\aaMisc\dariogiova\dvchitest.py”, line 14,
in test
print(view.HitTest(pos, item, col))
TypeError: DataViewCtrl.HitTest(): too many arguments
So, looks like there is a problem with HitTest.
Could you use instead ‘EVT_DATAVIEW_ITEM_ACTIVATED’?
Werner