Re: [Vala] GLib.Menu subclass
- From: Chris Daley <chebizarro gmail com>
- To: Ondrej Tuma <konference webjet cz>
- Cc: vala <vala-list gnome org>
- Subject: Re: [Vala] GLib.Menu subclass
- Date: Wed, 29 Jun 2016 07:58:54 -0700
Indeed, it should have a more meaningful error. Don't forget to file a bug
report!
I have seen this behaviour with some other classes and I suspect it will
become more and more common as GLib/GTK/Clutter move towards preferring
composition over inheritance (and in certain cases enforcing it). Does Vala
need a "final" or "sealed" keyword for Classes?
Chris
2016-06-29 1:58 GMT-07:00 Ondrej Tuma <konference webjet cz>:
V Wed, 29 Jun 2016 07:39:13 +0000
Luc Chante <luc chante gmail com> napsáno:
Hi,
https://developer.gnome.org/gio/stable/GMenu.html#GMenu.other_details
I'm not sure that GLib.Menu made to be overridable.
In python PyObject is possible. But if could not be, that should not be
in Vala, so the error should be from Vala not from C compiler.
You could decorate it : extend MenuModel, with a private property
which is a Menu, and override every methods of MenuModel by calling
the private property.
private GLib.Menu internal_men;
public override int get_n_items() {
return this.internal_menu.get_n_items();
}
Le mer. 29 juin 2016 à 08:44, Ondrej Tuma <konference webjet cz> a
écrit :
Hi all,
I try to create GLib.Menu subclass, but it fails. Here is code:
public class MyMenu : Menu {
public MyMenu(){
append ("Item label", "app.my-action");
}
}
And here is error:
/home/mcbig/tmp-dev/vala/gmenu.vala.c:39:8: error: field
‘parent_instance’ has incomplete type
GMenu parent_instance;
^
/home/mcbig/tmp-dev/vala/gmenu.vala.c:44:2: error: unknown type name
‘GMenuClass’
GMenuClass parent_class;
^
error: cc exited with status 256
Yes, there is not GMenuClass in gio/gio.h. I'm not sure if this
problem is in gio/gio.h or gio-2.0.vapi. I got this error on debian
Jessie (valac-0.26).
What I see, glibmm define it's GMenuClass in it's giomm/menu.h.
--
Ondřej Tůma <mcbig zeropage cz>
www: http://ipv6.mcbig.cz jabber: mcbig jabber cz twitter: mcbig_cz
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
--
Chris Daley
Pacific Northwest
e: chebizarro gmail com
w: http://chrisdaley.biz
m: +1-971-703-9251
s: chebizarro
tw: chebizarro
tz: PDT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]