[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug/lack of documentation for {editor-view}:add-button-in-menu




Look at the following two, slightly different definitions for 
an :add-button-in-menu function. The first one creates a button
without links, the second one does it correctly. 

	What's going wrong???


(de :add-button-in-menu (ctview menurank button . buttonrank)
  ;; same as {editor-view}:add-button-in-menu, but does the attachement
  ;; automatically

  ;; otional argument
  (if buttonrank (setq buttonrank (car buttonrank)))

  ;; adding the button
  ({editor-view}:add-button-in-menu ctview menurank button buttonrank)

  ;; attaching links
  ({link}:attach button 'ctedit (send 'object ctview))
  ({link}:attach button 'ctview ctview)

  button)




(de :add-button-in-menu (ctview menurank button . buttonrank)
  ;; same as {editor-view}:add-button-in-menu, but does the attachement
  ;; automatically

  ;; otional argument
  (if buttonrank (setq buttonrank (car buttonrank)))

  ;; attaching links
  ({link}:attach button 'ctedit (send 'object ctview))
  ({link}:attach button 'ctview ctview)

  ;; adding the button
  ({editor-view}:add-button-in-menu ctview menurank button buttonrank)

  button)


My guess: the actually inserted button is in fact a copy of the one
provided to {editor-view}:add-button-in-menu. In the first case, the
links are attached to the original *after* the insertion of a copy of
it.  -->> BUG


	Guido