Re: Changing/Setting end_arrow from python Again

At 06.03.2009 09:50, Philip Cavaco wrote:
Could the arrow be set similarly to colour.
There are two ways to set colors: either by name or by tuple/array with 3 data points. Both describe the complete color and not just a part of it.

I mean that just the type
can be specified as a number and the default settings for width and
length are used,["start_arrow"] = 17

This definition would be incomplete, and there is no precedence in the API (at least that I know of).
or a triple as you suggested.
Yes, but exclusive.

This way we wouldn't have to add the named enums.
The concept of setting an int by a named constant "enum" is completely orthogonal, as in:["start_arrow"] = (dia.ARROW_BLANKED_BOX, .5, .5)

versus:["start_arrow"] = (17, .5, .5)

We would need a way to find the default width and length values
for a given type though. I am not sure where this information is.

Actually looking into the code should help. See: lib/arrows.h

But now it is not any longer necessary cause I just commited:

2009-03-08  Hans Breuer  <hans breuer org>

        * plug-ins/python/pydia-property.c : implement PyDia_set_Arrow() to
        allow modification of line ends from python scripts, like:
      ["start_arrow"] = (17, .5, .5)

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert

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