line-dash worries



hi,

I have some lines which are either dashed or solid. If use the code
below it crashed in goocanvas. So apparently it is not okay to use NULL
for solid.

line = goo_canvas_polyline_new (canvas_root, FALSE, 2,
         x1, y1, x2, y2,
          "line-width", 1.0,
          "line-dash", (is_dashed ? line_pattern_dotted : NULL),
          NULL);

Of course I can do:
if (is_dashed) {
  line = goo_canvas_polyline_new (canvas_root, FALSE, 2,
         x1, y1, x2, y2,
          "line-width", 1.0,
          "line-dash", line_pattern_dotted,
          NULL);
} else {
  line = goo_canvas_polyline_new (canvas_root, FALSE, 2,
         x1, y1, x2, y2,
          "line-width", 1.0,
          NULL);
}

but that is clumsy. Is there a better way?

Stefan



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