[Vala] Accessing a foreign class property



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]