[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help on Item/Grob creation
From: |
Jan Nieuwenhuizen |
Subject: |
Re: Help on Item/Grob creation |
Date: |
Thu, 11 Nov 2004 09:55:11 +0100 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Carl Sorensen writes:
> I've (somewhat) successfully created a FretDiagrams context, with a
> Fret_diagram_engraver.
Great.
> As part of the engraver, I have the code
>
> fret_diagram_ = make_item ("FretDiagram",SCM_EOL); //WHAT GOES HERE?
>
> It appears to me that the "name" of the Item, FretDiagram, is in fact a
> pointer into scm/define-grobs.scm.
Yes.
> Since I want to make a FretDiagram
> Item, I believe I need to make an alist entry for FretDiagram in
> scm/define-grobs.scm. Is there any documentation for what goes in the
> alist entry?
In the alist entry go the immutable properties that describe a Grob.
Look at other Grob definitions for inspiration.
> Also, as part of making the item, I need to have a "cause", which is
> SCM_EOL in this particular example. It appears from some of the
> internal documentation that the cause is a music expression, generally
> the one responsible for creating the Item/Grob. What is the cause used
> for?
Cause is used for constructing error and warning messages to the user.
You use the music request form try_music () that caused the engraver
to create the Item.
> Also, what is the difference between an Item and a Grob? From some
> earlier descriptions, I think that an Item is one type of Grob; that is,
> all Items are Grobs, but not all Grobs are Items (i.e. some Grobs can be
> Spanners, etc.). Is this correct?
Yes, that's correct.
Jan.
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien | http://www.lilypond.org