lilypond-user
[Top][All Lists]
Advanced

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

Re: Attaching an alist to a grob


From: Urs Liska
Subject: Re: Attaching an alist to a grob
Date: Tue, 13 Jan 2015 23:15:25 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


Am 13.01.2015 um 21:41 schrieb Urs Liska:
Hi Paul,

thanks for that.
Will have to try that out later today, but indeed it looks exactly like what I'm looking for.
I think I can soon give back the results :-)

Now I've checked - it's perfect. Thank you again!

There is no alist? predicate, but it's very easy to define:

#(define (alist? lst)
   (and (list? lst)
          (every pair? lst)))

Best
Urs


Best
Urs

Am 13. Januar 2015 20:45:31 MEZ, schrieb Paul Morris <address@hidden>:
Urs Liska wrote
So does anyone have an idea how I can attach an alist to a grob so that an engraver can retrieve it? Is it for example possible to add an arbitrary property to a grob?
Hi Urs, I've had good luck creating custom grob properties, which sounds like what you're looking for. Here's how I do it, with some example custom properties that I use: %% CUSTOM GROB PROPERTIES %% I use "cn-" to keep my functions separate from standard %% LilyPond functions (like a poor man's namespace). % function from "scm/define-grob-properties.scm" (modified) #(define (cn-define-grob-property symbol type?) (set-object-property! symbol 'backend-type? type?) (set-object-property! symbol 'backend-doc "custom grob property") symbol) #(cn-define-grob-property 'cn-is-clairnote-staff boolean?) #(cn-define-grob-property 'cn-vscale-staff number?) Once they are defined I can use the custom properties with any grob (e.g. StaffSymbol): \override StaffSymbol.cn-is-clairnote-staff = ##t \override StaffSymbol.cn-vscale-staff = #1.2 I suppose for an alist you would just use list? as the type predicate (or maybe there's one for alists?). Cheers, -Paul -- View this message in context: http://lilypond.1069038.n5.nabble.com/Attaching-an-alist-to-a-grob-tp170412p170416.html Sent from the User mailing list archive at Nabble.com.
lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user


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


reply via email to

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