Beispiel #1
0
Handle<Value> Window::Style(const Arguments& args) {
  HandleScope scope;
  NativeWindow *window = ObjectWrap::Unwrap<NativeWindow>(args.This());
  switch (args.Length()) {
    case 0:
      return scope.Close(Integer::New(window->GetStyle(false)));
    case 1:
      if (args[0]->IsBoolean()) {
        return scope.Close(Integer::New(window->GetStyle(args[0]->BooleanValue())));
      } else {
        window->SetStyle(args[0]->Int32Value(), false);
      }
      break;
    case 2:
      window->SetStyle(args[0]->Int32Value(), args[1]->BooleanValue());
      break;
  }
  return scope.Close(args.This());
}
Beispiel #2
0
void Window::SetStyle(Local<String> property, Local<Value> value, const AccessorInfo& info) {
  NativeWindow *window = ObjectWrap::Unwrap<NativeWindow>(info.Holder());
  window->SetStyle(value->Int32Value());
}