DVUI

close_chain

Parameters

#
self:*MenuWidget
*MenuWidget
reason:CloseReason
CloseReason

Source

Implementation

#
pub fn close_chain(self: *MenuWidget, reason: CloseReason) void {
    dvui.dataRemove(null, self.data().id, "_submenus_activating");
    self.submenus_activated = false;
    // close all submenus in the chain
    if (self.parentMenu) |pm| {
        pm.close_chain(reason);
    } else {
        if (Root.current) |root| {
            root.close(root.ptr, reason);
        }
        if (reason == .intentional) {
            // when a popup is closed because the user chose to, the
            // window that spawned it (which had focus previously)
            // should become focused again
            dvui.focusSubwindow(self.init_opts.parentSubwindowId, null);
        }
    }
}