> When casting to PicassoLine or PicassoRectangle it pop up:
> (Picasso:10091): GLib-GObject-WARNING **: invalid cast from 
> `PicassoPicassoItem' to `PicassoPicassoRectangle' (or PicassoPicassoLine)

Try changing

((PicassoLine) canvas.preview).....

to

(canvas.preview as PicassoLine)....

If that still gives you warnings, try declaring
PicassoItem class as *abstract* so that you don't
accidentally do something like this:

  var type = ItemType.NONE;
  PicassoItem item = new PicassoItem(0, 0, type); // big mistake!
  item.type = ItemType.CIRCLE;   // big mistake!

By the way, I'm sure you don't need ItemType.
Vala supports runtime class check.

hand


_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to