windows/ c++ / wxwidgets 2.8.?
I have a wxGenericDirCtrl. I am doing a connect on the wxEVT_COMMAND_TREE_SEL_CHANGED event to do some things when the user single clicks on the directory tree. This works.
However I'd also like to expand the node they click on if it is expandable. Unfortunately if I do that when I deal with the above event I go into an endless loop - I think because the dirCtrl->ExpandPath(path) causes another wxEVT_COMMAND_TREE_SEL_CHANGED to be fired. How do I get around this problem?
event triggering madness Topic is solved
(Moved from wxCode forum, which is intended for discussions of the projects residing at wxCode.)
Hi,
Well, you could use EVT_TREE_ITEM_ACTIVATED instead (that's generated by a double-click).
Alternatively, you could Disconnect() wxEVT_COMMAND_TREE_SEL_CHANGED until things have settled down, then re-Connect() it again.
Regards,
David
Hi,
Well, you could use EVT_TREE_ITEM_ACTIVATED instead (that's generated by a double-click).
Alternatively, you could Disconnect() wxEVT_COMMAND_TREE_SEL_CHANGED until things have settled down, then re-Connect() it again.
Regards,
David
Thanks for your reply David. I'll try the disconnect idea. I hadn't thought of that.
DavidHart wrote:
Well, you could use EVT_TREE_ITEM_ACTIVATED instead (that's generated by a double-click).
Alternatively, you could Disconnect() wxEVT_COMMAND_TREE_SEL_CHANGED until things have settled down, then re-Connect() it again.
Regards,
David