Reinhold Kainhofer schrieb:
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.
Ah, that's interesting - I understood Wilbert Berendsen's lambda construct
(and wondered why I didn't came up with that myself ...) but this is new to me. Great!
and wanted to call it by

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

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

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

Marc
Cheers,
Reinhold


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

Reply via email to