Hello,
I've ported my wx app to linux and I'm having difficulty getting double click actions to work with wxDataViewCtrl.
A double click in a DataView column is to generate a wxDataViewEvent object for: EVT_DATAVIEW_ITEM_ACTIVATED
The docs for wxDataViewEvent.GetColumn() says, "...or -1 if no column field was set by the event emitter. "
Can someone please explain what "set by the event emitter" means?
The same code, wxDataViewEvent.GetColumn() works correctly on Windows, the correct column number is returned.
Other discovery on Linux shows, wxDataViewEvent.GetDataViewColumn() returns NULL. This suggest the wxDataViewEvent isn't initialized correctly.
Any insight is appreciated.
Thanks,
Patrick
wxDataViewEvent.GetColumn() returns -1
Re: wxDataViewEvent.GetColumn() returns -1
That's another was of saying that this information might not be available on all platforms - as you just found out.The docs for wxDataViewEvent.GetColumn() says, "...or -1 if no column field was set by the event emitter. "
Can someone please explain what "set by the event emitter" means?
If you really need the column, you can calculate it yourself using the mouse position and the widths of the columns.
Use the source, Luke!
Re: wxDataViewEvent.GetColumn() returns -1
Can you provide some insight as to why this behavior doesn't work on Linux?
Re: wxDataViewEvent.GetColumn() returns -1
Not really. But i know that under Linux/GTK a native control is used, while under Windows it's a generic implementation. I guess the native version just doesn't provide this information.tengai wrote:Can you provide some insight as to why this behavior doesn't work on Linux?
Use the source, Luke!
Re: wxDataViewEvent.GetColumn() returns -1
Hi,
Looking at the code lines 4462-4469, it looks like the functionality is provided but disabled (Notice the parameter is set as WXUNUSED()).
I'd ask the question on the wx-dev ML andmaybe Paul or Vadim give more insight, why this is the case.
Thank you.
Looking at the code lines 4462-4469, it looks like the functionality is provided but disabled (Notice the parameter is set as WXUNUSED()).
I'd ask the question on the wx-dev ML andmaybe Paul or Vadim give more insight, why this is the case.
Thank you.
Re: wxDataViewEvent.GetColumn() returns -1
Hi,
For anybody interested - I sent an E-mail to the wx-dev ML about this issue.
Thank you.
For anybody interested - I sent an E-mail to the wx-dev ML about this issue.
Thank you.
Re: wxDataViewEvent.GetColumn() returns -1
Hi,
FYI, this has been fixed today.
The "column" parameter is now available in the actiavted event of wxDVC.
All 3 major platforms - MSW, *nix/GTK and OSX/Cocoa have this functionality available.
Thank you.
FYI, this has been fixed today.
The "column" parameter is now available in the actiavted event of wxDVC.
All 3 major platforms - MSW, *nix/GTK and OSX/Cocoa have this functionality available.
Thank you.