vala-code
vala-code copied to clipboard
Construct gobject field
Problem:
Code:
public class Person : Object {
/* Construction properties */
public string name { get; construct; }
public int age { get; construct set; }
public Person(string name) {
Object(name: name);
}
public Person.with_age(string name, int years) {
Object(name: name, age: years);
}
construct {
// do anything else
stdout.printf("Welcome %s\n", this.name);
}
}