Am 04.04.2017 um 13:48 schrieb Urs Liska:
> Hi,
>
> one more time a question about the order of operations.
>
> In the following MWE I use ly:grob-set-property! in the
> before-line-breaking callback to set the X-offset property of the
> NoteHead's parent NoteColumn.
>
> This has the expected effect and visually offsets the note column
> accordingly, but when I read out the property with ly:grob-property in
> the after-line-breaking callback (the stencil callback that I actually
> use behaves the same) it returns '(), i.e. "unset".
>
>
> \version "2.19.54"
>
> {
>   \override NoteHead.before-line-breaking =
>   #(lambda (nh)
>      (let ((nc (ly:grob-parent nh Y)))
>        (ly:grob-set-property! nc 'X-offset 4)))
>   \override NoteHead.after-line-breaking =
>   #(lambda (nh)
>      (let ((nc (ly:grob-parent nh Y)))
>        (ly:message "offset : ~a" (ly:grob-property nc 'X-offset))))
>   c'1
> }
>  
> I'm somewhat confused that at the later point in time the property
> seemingly isn't present although it obviously does what I expect it to do.
>
> The background is: I need to offset the note column to make space for an
> object left to it. As I can't do that automatically I want to write out
> a message telling the user to what value he has to set the x offset.
> This setting of the x offset happens during before-line-breaking, they
> can't use \override in the input files. With the behaviour as I see it I
> can only say "please add N to your current X-offset" (instead of "set
> X-offset to M").
>
> Any explanations or suggestions?
>
> TIA
> Urs
>

Just for the record: I've found a workaround by saving the offset in the
before-line-breaking function, so I can add that value later to report
the correct data. But it's still confusing ...

Urs

-- 
u...@openlilylib.org
https://openlilylib.org
http://lilypondblog.org


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

Reply via email to