Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


Neil Puttock schrieb:
2009/10/31 Marc Hohl <marc@xxxxxxxxxx>:

The syntax

(ly:grob-set-property! grob '(bound-details right X) right-X)

won't work, however. How can I put the new value into the list?

You'll have to do some C++ hacking.  There are two options here (see
the code in grob-scheme.cc):

1) amend ly_grob_set_property_x () to allow lists

2) create a new exported function ly_grob_set_nested_property_x ()

I favour the latter, since it's cleaner to implement: if you amend
ly:grob-set-property! you'll have to use a hybrid type check, since
the property path could be either a symbol or list.
Ok, I will have a look at the code. I am sure that questions will arise,
because c++ is new for me, but nevertheless ...
Or is my approach aiming in the wrong direction?

I think it's fine for a tweak, but a better fix would involve working
directly on the code in line-spanner.cc.
Hm, probably.
              (set! right-X (- right-X 30)))

You could get a compensatory value automatically by using
ly:grob-extent on the accidental.
Yes, the value was simply a quick test to see whether
my approach will work as I expected, but I didn't work
on the grob-extent, because ly:grob-set-property! failed.

Whatever you decide to do, allowing nested properties in
ly:grob-set-property! would be a useful enhancement.
So I concentrate on this, try to solve it and afterwards come back to the initial problem. If I follow proposal 2, there will be a ly:grob-set-nested-property!
function, am I right?

Thanks for your reply!

Marc
Regards,
Neil

---

----
Join the Frogs!




---

----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/