Re: how to do a dash line in goocanvas



On Sun, 2013-09-22 at 11:36 +0100, Damon Chaplin wrote:
On Sat, 2013-09-21 at 19:25 -0400, D M German wrote:
hi everybody,

During the last week I am been trying to port xournal
(http://xournal.sourceforge.net)

so far so good, i am doing progress.

Something that has stumped me is, how do I do a dash line?

Say for example, that I have a goo_canvas_item that is a rectangle.

How do I change its line style from normal to dashed?

is there some property that I can set with g_object_set (as it with
other properties, such as x, y, colors, etc?

This is probably this bug (Introspection & GooCanvasLineDash):
  https://bugzilla.gnome.org/show_bug.cgi?id=703592

I'll try to fix it in the next release. I guess I should do one fairly
soon.


It looks like all we need are these added introspection options to
@dashes:

/**
 * goo_canvas_line_dash_newv:
 * @num_dashes: the number of dashes and gaps in the pattern.
 * @dashes: (array length=num_dashes) (transfer full): a g_new-allocated
vector
 * of doubles, the length of each dash and gap.


Then this seems to work fine:

    GooCanvas.CanvasPath (parent=root,
                  data="M20,100 C20,50 100,50 100,100 S180,150 180,100",
                  line_dash=GooCanvas.CanvasLineDash.newv((10.0, 10.0)),
                  )

Is that OK/enough? I'm not an expert on introspection or python so I'm
not 100% sure myself.

Damon




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