lilypond-devel
[Top][All Lists]
Advanced

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

custom-grob-properties, add 'details to grob-interface?


From: Thomas Morley
Subject: custom-grob-properties, add 'details to grob-interface?
Date: Tue, 6 Feb 2018 23:29:02 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]