Re: [Vala] Warning while casting custom classes
- From: Stephen Smally <eco stefi fastwebnet it>
- To: vala-list gnome org
- Subject: Re: [Vala] Warning while casting custom classes
- Date: Mon, 23 Jul 2012 10:34:06 +0200
Il 23/07/2012 02:02, Nor Jaidi Tuah ha scritto:
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
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
Thanks but i already solved this problem, i was casting PicassoItem to
PicassoLine without having PicassoLine initialized...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]