Am Sonntag, 26. September 2010, um 20:19:28 schrieb Marc Hohl:
> is it possible to create a callback with an additional argument?

Yes, that's possible. I'm using it for example for the glyph-flag flag style.



> I tried
> 
> #(define-public (my-callback string grob)
> ...
> ..
> )

#(define-public ((glyph-flag flag-style) stem-grob)
  "Simulates the default way of generating flags: look up glyphs
   flags.style[ud][1234] from the feta font and use it for the flag stencil."
  (create-glyph-flag flag-style "" stem-grob))

Notice that the function name and the first argument are in parenthesis. Think 
of it like glyph-flag being a function that returns a function.

> and wanted to call it by
> 
> \override Notehead #'stencil = #my-callback #'foo'

#(define-public ((my-callback string) grob)
  .....
)

\override Notehead #'stencil = #(my-callback 'foo)

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to