lilypond-devel
[Top][All Lists]
Advanced

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

Re: cleanup: infinity, get property (issue 6310043)


From: David Kastrup
Subject: Re: cleanup: infinity, get property (issue 6310043)
Date: Fri, 15 Jun 2012 18:48:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Janek Warchoł <address@hidden> writes:

> On Fri, Jun 15, 2012 at 6:00 PM, David Kastrup <address@hidden> wrote:
>> What makes you think LyricText is an Item?  Its definition is
>>
>> class Lyric_text
>> {
>> public:
>>  DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM));
>>  DECLARE_GROB_INTERFACE ();
>> };
>>
>> It is a class with one member function and an interface.  That does not
>> make it an Item.  If you want it to be an Item, you need to have it
>> inherit from Item in which case it will know its context (and
>> consequently how to get properties) from the way it has been created.
>
> indeed, i'm more silly than i thought.
> Is the inheritance correct now?
> I still get an error, though...
> Btw, why doesn't Flag inherit from Item?

Good question.  Looking through this and stem, it would seem that this
does not work via inheritance but rather callbacks.  So disregard what I
said previously.

You likely want to use a grob property, in which case you would write
me->get_property (...).  Using a context property does not make sense
here since the lifetime of a grob is not synchronized to the lifetime of
context properties.

-- 
David Kastrup



reply via email to

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