I have found a solution to toggle the display of a contextual submenu (eg: nicklist,channel).
alias -l enamnu { .enable #mnu | .timer 1 0 .disable #mnu }
menu nicklist,channel {
$iif( (test if submenu should be displayed) ,$enamnu)
}
#mnu off
menu nicklist,channel {
Submenu name
.$submenu(...)
...
}
#mnu end
It works perfectly. The reason to do this is to prevent mirc from calling the $submenu alias which is time consuming in this particular case.
Do you see any disadvantage in using enable/disable?