예제 #1
0
KJS::Object KstBindLine::construct(KJS::ExecState *exec, const KJS::List& args) {
  if (args.size() != 1) {
    return createSyntaxError(exec);
  }

  KstViewObjectPtr view = extractViewObject(exec, args[0]);
  if (!view) {
    KstViewWindow *w = extractWindow(exec, args[0]);
    if (w) {
      view = w->view();
    } else {
      return createTypeError(exec, 0);
    }
  }

  KstViewLinePtr b = new KstViewLine;
  view->appendChild(b.data());
  KstApp::inst()->paintAll(KstPainter::P_PAINT);
  return KJS::Object(new KstBindLine(exec, b));
}
예제 #2
0
KstBindLine::KstBindLine(KJS::ExecState *exec, KstViewLinePtr d, const char *name)
: KstBindViewObject(exec, d.data(), name ? name : "Line") {
  KJS::Object o(this);
  addBindings(exec, o);
}