On Tue, 21 May 2013 00:14:01 +0300 Eran Ifrah wrote:
EI> I often use wxCommandEvent to pass around commands from one handler to
EI> another One of the pains I am having is to keep track of the
EI> wxClientData I am setting in the event (i.e. delete it when its no
EI> longer needed)
I think this is a rather unusual situation. The client data is supposed to
be owned by a control, not event.
EI> I ended up writing a small class like this:
Of course, if you do want to have client data in your events, your
approach works just fine.
EI> This seems a very useful to me and I wondered whether you consider
EI> extending wxCommandEvent with new API something like (using 'Assign' to be
EI> consistent with other APIs):
EI>
EI> AssignClientObject / GetAssignedClientObject
No, I don't think this is useful enough to be done in wxCommandEvent. I'm
also a bit suspicious of the whole idea, it doesn't seem right to me to
have objects owned by the events even if I can't give any concrete reason
as to why would it be so right now. So I'd prefer to not change anything in
wxCommandEvent.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/