Repository navigation
|
Good day. Please tell me how to create a new instance of a class that inherits from a subclass. In the documentation https://gircore.github.io/docs/integration/diagnostic/1007.html a subclass example is described, and to create a new instance, it is necessary to use the NewWithProperties([]) function. I cannot understand how to proceed if I have inheritance from a subclass. |
Answered by
badcel
Mar 17, 2026
Replies: 1 comment 2 replies
|
If I understand you correctly you want to create a subclass of a subclass? You would do it in the same way: using GObject;
[Subclass<Row>]
public partial class ConfiguratorItemRow
{
public static ConfiguratorItemRow New()
{
return NewWithProperties([]);
}
}
[Subclass<GObject.Object>]
partial class Row
{
public static Row New()
{
return NewWithProperties([]);
}
} |
2 replies
Answer selected by
badcel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I understand you correctly you want to create a subclass of a subclass? You would do it in the same way: