[Vala] Accessing a foreign class property
- From: Paul Marques Mota <pmarquesmota gmail com>
- To: vala-list gnome org
- Subject: [Vala] Accessing a foreign class property
- Date: Sun, 8 Jul 2012 12:02:27 +0200
Hello,
The following code yields an error "invocation not supported in this
context". Is there a way for test2 to access test1 property?
public class test1 {
public enum state {
FILL,
DRAW
}
private static state _state;
public static state drawing_state {
get { return _state; }
set { _state = value; }
}
public void test1 () {
_state = state.DRAW;
}
}
public class test2 {
public static void m () {
if (test1.drawing_state() == state.FILL) {
stdout.printf("FILL\n");
} else {
stdout.printf("DRAW\n");
}
}
}
public static int main (string[] args) {
test2.m();
return 0;
}
Thank you,
--
Paul
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]