damellis / ESP

The Example-based Sensor Predictions (ESP) system applies machine learning to real-time sensor data.
BSD 3-Clause "New" or "Revised" License
224 stars 52 forks source link

Disable event listeners for GUI elements on non-active tabs. #353

Closed damellis closed 8 years ago

damellis commented 8 years ago

This could involve explicitly disabling and re-enabling the listeners when the user switches tab, or we could have each event listener check the application state internally.

damellis commented 8 years ago

This still seems to be a problem, despite: https://github.com/damellis/ESP/commit/3f0aec010960fc2535079fed4d30504c748b9a91

damellis commented 8 years ago

This is probably the most important thing on the list, since accidentally clicking the buttons on the training data tab can delete data, etc.

nebgnahz commented 8 years ago

I think the issue is here: https://github.com/braitsch/ofxDatGui/blob/master/src/ofxDatGui.cpp#L846

Even if we explicitly set the GUI elements to be disabled, ofXDatGui checks for mouse event to set the active element. And inside ofxDatGui::focus(), the mEnabled is set to be true.

Setting elements to be invisible would do the trick.