Hi,

quite often I use custom-grob-properties to get my codings work, like here
http://lsr.di.unimi.it/LSR/Item?id=1032

I'm aware there are reservations about doing this a lot.

Using `details.custom-property' seems to be another way.
An admittedly silly, but close to minimal example, only demonstrating
the method:

#(define color-me-red
  (lambda (grob)
    (if (assoc-get 'color-red (ly:grob-property grob 'details))
        red)))

\layout { \override NoteHead.color = #color-me-red }

{ \override NoteHead.details.color-red = ##t c'1 }

Real examples are mostly stencil-overrides where I want to set several
values, depending on the current situation.


Though, I came across the problem that compiling it with
-dcheck-internal-types will return:
programming error: Grob `NoteHead' has no interface for property `details'.


So why not add the 'details-property to the grob-interface, instead of
being restricted to some grobs like beam, stem, maybe others (I didn't
look at them all)?
This would offer the user a wide possibility to code what he wants
without the need to fiddle around with set-object-property!


Thoughts?

Cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to