Better script based popup menu support - 14/10/06 06:26 PM
First off, I love this suggestion. I have a few more ideas regarding menus...
First, a new identifer $menuselect. It would return the text of the menu item selected. Here is an example of why... My connect event changes a list, I call "recent servers". If a popup menu is created before changing this list, yet my selection occurs after changing this, the menu selection will most likely be invalid. Parsing a $menutext identifer would fix this problem.
Second and best shown with code...
First, a new identifer $menuselect. It would return the text of the menu item selected. Here is an example of why... My connect event changes a list, I call "recent servers". If a popup menu is created before changing this list, yet my selection occurs after changing this, the menu selection will most likely be invalid. Parsing a $menutext identifer would fix this problem.
Code:
; For the sake of example here, $menuselect equals "irc.irc.net 6667". ; since $svrname and $svrport could change between popup creation, ; and selection of menu item, use $menuselect instead menu RecentServers { $iif($isrecent(1), $svrname(1) $svrport(1)):{ server $menuselect } }
Second and best shown with code...
Code:
; Get rid of menu status { Animal .$submenu($animal($1)) } alias animal { if ($1 == begin) return - if ($1 == 1) return Cow:echo Cow if ($1 == 2) return Llama:echo Llama if ($1 == end) return - }
Code:
; In favor of menu status { Animal .$submenu(animal) } menu animal { Cow:echo Cow Llama:echo Llama }