When I push a menu, I want to be able to prevent the 'back button' from popping the view. Is this possible?
When I push a menu, I want to be able to prevent the 'back button' from popping the view. Is this possible?
on devices that support Menu2, use that.
Hi,
Usually for a view, you override the onBack() method of your behavior delegate and return true to indicate you have handled the event.
function onBack() { return true; }
This will also work with a Toybox::WatchUi::Menu2
view, using the Toybox::WatchUi::Menu2InputDelegate
.
However if using the Toybox::WatchUi::Menu
, then you use a Toybox::WatchUi::MenuInputDelegate
which does not provide onBack() override.
Note that Menu2 is limited to CIQ 3+.
Hello,
I know that returning "false" in the onBack function pops the view. Where is it documented that the default method of the onBack event pops the current view? There must be somewhere a list of those default behaviors ? (also for onSelect, onMenu and so)
The default for onBack() pops the view, as that's the way to exit an app. Things like onMenu(), onSelect(), and onNextPage(), really don't. If you have a hander for them, you want to return true though. The venu and va devices may act differently if you don't, and you won't see it in the sim