Lisp HUG Maillist Archive

define-menu argument confusion

Hi,

The documentation on define-menu states that it "defines a function called function-name with a single argument self that will make a menu". However, nothing is said about what the argument self does.

Using macroexpand shows that the self variable is passed on to make-instance of the menu, like (make-instance 'capi:menu :menu-interface self). However that initarg is undocumented, so it is still hard to tell what it does.

My question is really: is it safe to define a menu with define-menu, and then calling the menu-creating function with nil? Or do I really have to pass the actual interface in which the menu is going to be used? I would have thought that callbacks using callback-type :interface would then be passed nil, but that is not the case, they still work as usual!

Erik

Updated at: 2020-12-10 08:35 UTC