Re: dashline migration from 0.14 to 2.0



Le 02/07/2013 10:30, Damon Chaplin a écrit :
On Mon, 2013-07-01 at 20:54 +0200, Serge Noiraud wrote:
Hi,

I have a porting problem with dash lines.
With goocanvas 0.14
the python program used :

              item = goocanvas.Path(parent = self.current_parent(),
                                    data = p_data,
                                    stroke_color = stroke_color,
                                    line_width = 1,
                                    line_dash = goocanvas.LineDash([5.0, 5.0]))

Someone port it to :

              item = GooCanvas.CanvasPath(parent = self.current_parent(),
                                          data = p_data,
                                          stroke_color = stroke_color,
                                          line_width = 1,
                                          line_dash = GooCanvas.LineDash([5.0, 5.0]))

It crashed because GooCanvas.LineDash accept no argument.
What is the best way to have the same functionality ?
I think the same problem occurred with GooCanvas.CanvasPoints.
Apparently boxed types do not allow arguments to constructors with
introspection. So the __new__ function was overridden. See
bindings/python/GooCanvas.py.

Maybe you can do the same thing for LineDash.

A long-term solution I guess would be to add a function like
goo_canvas_line_dash_set_dashes() to set the dash data after it has been
created. (We also need a set_dash_offset().)

Damon
Too complicated for me as I don't understand what is done. Is there a easier method ?
I think it's a bug do I need to report it ?



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