[Vala] Inheriting from GLib.Action
- From: Edward Hennessy <ehennes sbcglobal net>
- To: vala-list gnome org
- Subject: [Vala] Inheriting from GLib.Action
- Date: Thu, 27 Feb 2014 08:09:09 -0800
Hello,
I'm trying to create custom actions by inheriting from GLib.Action, however,
the following code:
public class CloseProjectAction : Object, Action
{
public bool enabled
{
get
{
return true;
}
}
public bool get_enabled()
{
return true;
}
/* more method implementations... */
}
Results in the following error:
CloseProjectAction.c:146:17: error: redefinition of ‘close_project_action_real_get_enabled’
static gboolean close_project_action_real_get_enabled (GAction* base) {
^
CloseProjectAction.c:71:17: note: previous definition of ‘close_project_action_real_get_enabled’ was here
static gboolean close_project_action_real_get_enabled (GAction* base) {
^
There are similar errors for every property and corresponding get method in the derived class. There are
indeed two functions of the same name in the .c output, functionally equivalent. Removing either the property
or the method generates a different set compile errors:
CloseProjectAction.vala:3.1-3.48: error: `CloseProjectAction' does not implement interface method
`GLib.Action.get_enabled'
Is there a mechanism I can get inheritance from GLib.Action to work?
Cheers,
Ed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]