MCPcopy Create free account
hub / github.com/VCVRack/Rack / createBoolMenuItem

Function createBoolMenuItem

include/helpers.hpp:300–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298*/
299template <class TMenuItem = ui::MenuItem>
300TMenuItem* createBoolMenuItem(std::string text, std::string rightText, std::function<bool()> getter, std::function<void(bool state)> setter, bool disabled = false, bool alwaysConsume = false) {
301 return createCheckMenuItem<TMenuItem>(text, rightText, getter, [=]() {
302 setter(!getter());
303 }, disabled, alwaysConsume);
304}
305
306
307/** Easy wrapper for createBoolMenuItem() to modify a bool pointer.

Callers 3

appendContextMenuMethod · 0.85
onActionMethod · 0.85
createBoolPtrMenuItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected