How to use the lively.bindings.connect function in lively

To help you get started, we’ve selected a few lively examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LivelyKernel / lively.morphic / ide / shell / workspace.js View on Github external
ensureCwdButton(cwd) {
    var btn = this.getSubmorphNamed("changeCwdButton")
     if (btn) return btn;
     btn = morph({
      type: "button", name: "changeCwdButton",
      padding: Rectangle.inset(4,2),
      label: cwd || "...", extent: pt(60,20), borderRadius: 3
    });
    connect(btn, 'fire', this, 'execCommand', {converter: () => "[shell] change working directory"});
    return btn;
  }
github LivelyKernel / lively.morphic / components / window.js View on Github external
resizer() {
    var win = this, resizer = this.getSubmorphNamed("resizer");
    if (resizer) return resizer;
    resizer = morph({
      name: "resizer",
      nativeCursor: "nwse-resize",
      extent: pt(20, 20),
      origin: pt(20,20),
      fill: Color.transparent,
      bottomRight: this.extent
    });
    connect(resizer, "onDragStart", resizer, "scale", {converter: evt => 10});
    connect(resizer, "onDrag", win, "resizeBy", {converter: evt => evt.state.dragDelta});
    connect(resizer, "onDragEnd", resizer, "scale", {converter: evt => 1});
    return resizer;
  }
github LivelyKernel / lively.morphic / components / window.js View on Github external
resizer() {
    var win = this, resizer = this.getSubmorphNamed("resizer");
    if (resizer) return resizer;
    resizer = morph({
      name: "resizer",
      nativeCursor: "nwse-resize",
      extent: pt(20, 20),
      origin: pt(20,20),
      fill: Color.transparent,
      bottomRight: this.extent
    });
    connect(resizer, "onDragStart", resizer, "scale", {converter: evt => 10});
    connect(resizer, "onDrag", win, "resizeBy", {converter: evt => evt.state.dragDelta});
    connect(resizer, "onDragEnd", resizer, "scale", {converter: evt => 1});
    return resizer;
  }
github LivelyKernel / lively.morphic / text / ui.js View on Github external
getOrAddButton(spec, connectTo) {
    let btn = this.getSubmorphNamed(spec.name);
    if (btn) return btn;
    if (!spec.tooltip) spec.tooltip = spec.name;
    btn = this.addMorph({...this.btnStyle, ...spec});
    connectTo && connect(btn, "fire", this, connectTo);
    return btn;
  }
github LivelyKernel / lively.next / lively.ide / shell / workspace.js View on Github external
ensureCwdButton(cwd) {
    var btn = this.getSubmorphNamed("changeCwdButton");
    if (btn) return btn;
    btn = morph({
      type: "button", name: "changeCwdButton",
      padding: Rectangle.inset(4,2),
      label: cwd || "...", extent: pt(60,20), borderRadius: 3
    });
    connect(btn, "fire", this, "execCommand", {converter: () => "[shell] change working directory"});
    return btn;
  }

lively

Express-like AWS Lamba framework

Apache-2.0
Latest version published 9 years ago

Package Health Score

40 / 100
Full package analysis