[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to return markup conditionally?
From: |
David Kastrup |
Subject: |
Re: How to return markup conditionally? |
Date: |
Wed, 19 Jul 2023 08:23:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Trevor Bača <trevorbaca@gmail.com> writes:
> Hi,
>
> I'd like the left text of red text spanners to be set to "foo", and to set
> the left text of all other text spanners to "bar".
>
> But I misunderstand how to return markup:
>
> %%% BEGIN %%%
>
> \version "2.25.3"
>
> % no left text set
> {
> \once \override TextSpanner.bound-details.left.text =
> #(lambda (grob) (if (equal? red (ly:grob-property grob 'color)) "foo"
> "bar"))
> c'1
> - \tweak color #red
> \startTextSpan
> c'1
> \stopTextSpan
> }
>
> % no left text set
> {
> \once \override TextSpanner.bound-details.left.text =
> #(lambda (grob) (if (equal? red (ly:grob-property grob 'color))
> (markup "foo")
> (markup "bar")))
> c'1
> - \tweak color #red
> \startTextSpan
> c'1
> \stopTextSpan
> }
>
> %%% END %%%
>
> What's the right way to return markup from a Scheme function?
You are doing fine in that regard, but subproperties don't have callback
evaluation.
--
David Kastrup
- How to return markup conditionally?, Trevor Bača, 2023/07/18
- Re: How to return markup conditionally?,
David Kastrup <=
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/19
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/19
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/19
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/19
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/20
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/20
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/21
- Re: How to return markup conditionally?, David Kastrup, 2023/07/20