2012/12/29 Noeck <noeck.marb...@gmx.de>:
> Hi,
>
> is there a way to make objects behave like links? I want an object (like
> a clef or a beam) to be a link to a website. From the point-and-click
> functionality it seems to be doable, but I only found the solution for
> markup (\with-url).
>
> If there is a user function or if someone knows how point-and-click
> works internally, I would be thankful for any help.
>
> Cheers,
> Joram
>
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi,

you could use this markup-command \with-url to add sth to the grob-stencil.

It's a hack, but all I can think of.

\version "2.17.9"

#(ly:set-option 'debug-skylines #t)

#(define (add-link strg)
  (lambda (grob)
    (let* ((stil (ly:grob-property grob 'stencil))
           (x-ext (ly:stencil-extent stil X))
           (y-ext (ly:stencil-extent stil Y))
           (link-stil (grob-interpret-markup
                         grob
                         (markup
                           #:with-url strg
                           #:with-dimensions x-ext y-ext
                           #:null)))
           (new-stil (ly:stencil-add
                        stil
                        link-stil)))
    (ly:grob-set-property! grob 'stencil new-stil))))


\relative c' {
  \override Staff.Clef.after-line-breaking =
    #(add-link
      "http://lilypond.org/doc/v2.17/Documentation/notation/writing-pitches";)
  \override Staff.TimeSignature.after-line-breaking =
    #(add-link
       "http://lilypond.org/doc/v2.17/Documentation/notation/rhythms";)
  \override NoteHead.after-line-breaking =
    #(add-link
       "http://lilypond.org/doc/v2.17/Documentation/notation/note-heads";)
  c''
}

HTH,
  Harm

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

Reply via email to