newer 发表于 2021-1-11 20:13:05

Appending a pop menu


问题:
Is there a way to tag a new pulldown menu at the end? For example, at the first
available position instead of at a fixed position? How do I know what this
position is so that I can swap the menus?

解答:
You can use the following function to find the last position on a pop menu:


(defun lastmenu(/ pos)
(setq pos 1)
(while (menucmd (strcat "P" (itoa pos) ".1=?"))
(setq pos (1+ pos))
)
pos
)

(defun c:placemenu()
(menucmd (strcat "P" (itoa (1- (lastmenu))) "+=mymenu.pop2"))
)

It is recommended you place the menu before the help menu instead of at the very
last position.

页: [1]
查看完整版本: Appending a pop menu