How to use the blessed.button function in blessed

To help you get started, we’ve selected a few blessed 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 chjj / blessed / test / widget-shrink-fail.js View on Github external
top: 4,
  left: 9,
  right: 1,
  height: 1,
  style: {
    bg: 'black',
    focus: {
      bg: 'blue'
    },
    hover: {
      bg: 'blue'
    }
  }
});

form._.submit = blessed.button({
  parent: form,
  name: 'submit',
  top: 6,
  right: 1,
  height: 1,
  //width: 'shrink',
  width: 10,
  content: 'send',
  tags: true,
  style: {
    bg: 'black',
    focus: {
      bg: 'blue'
    },
    hover: {
      bg: 'blue'
github freeCodeCamp / freeCodeCamp / setup.js View on Github external
content: ' SUBMIT ',
  style: {
    fg: 'blue',
    bg: 'white',
    focus: {
      fg: 'white',
      bg: 'red'
    }
  }
});

authSubmit.on('press', function() {
  authForm.submit();
});

var authCancel = blessed.button({
  parent: authForm,
  top: 13,
  left: 9,
  mouse: true,
  shrink: true,
  name: 'cancel',
  content: ' CANCEL ',
  style: {
    fg: 'blue',
    bg: 'white',
    focus: {
      fg: 'white',
      bg: 'red'
    }
  }
});
github freeCodeCamp / freeCodeCamp / setup.js View on Github external
content: ' SUBMIT ',
  style: {
    fg: 'blue',
    bg: 'white',
    focus: {
      fg: 'white',
      bg: 'red'
    }
  }
});

emailSubmit.on('press', function() {
  emailForm.submit();
});

var emailCancel = blessed.button({
  parent: emailForm,
  top: 9,
  left: 9,
  mouse: true,
  shrink: true,
  name: 'cancel',
  content: ' CANCEL ',
  style: {
    fg: 'blue',
    bg: 'white',
    focus: {
      fg: 'white',
      bg: 'red'
    }
  }
});
github astefanutti / kubebox / lib / ui / login.js View on Github external
bottom  : 0,
      content : 'Import...',
      style   : {
        focus : {
          bg : 'grey',
        },
        hover : {
          bg : 'grey',
        }
      }
    });
    config.on('press', () => kubebox.emit('kubeConfigImport'));
  }

  if (closable) {
    const cancel = blessed.button({
      parent  : form,
      mouse   : true,
      keys    : true,
      shrink  : true,
      padding : {
        left  : 1,
        right : 1,
      },
      right   : 10,
      bottom  : 0,
      content : 'Cancel',
      style   : {
        focus : {
          bg : 'grey',
        },
        hover : {
github heapwolf / lev / lib / ui / put.js View on Github external
}
    },
    keys: true,
    vi: true,
    hoverBg: 'black',
    height: 10,
    right: 2,
    left: 2,
    top: 12,
    filled: 50
  })

  var keyEditor = Editor(screen, put._.key)
  var valueEditor = Editor(screen, put._.value)

  var buttonExec = blessed.button({
    parent: put,
    bottom: 1,
    height: 1,
    right: 2,
    width: 6,
    content: ' Exec ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      }
    },
    hoverBg: 'black',
    hoverFg: 'white',
github heapwolf / lev / lib / ui / put.js View on Github external
content: ' Exec ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      }
    },
    hoverBg: 'black',
    hoverFg: 'white',
    autoFocus: true,
    mouse: true
  })

  var buttonCancel = blessed.button({
    parent: put,
    bottom: 1,
    height: 1,
    right: 9,
    width: 8,
    content: ' Cancel ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      }
    },
    hoverBg: 'black',
    hoverFg: 'white',
github heapwolf / lev / lib / ui / connections.js View on Github external
var textManifest = blessed.textbox({
    parent: form,
    mouse: true,
    keys: false,
    bg: 243,
    fg: 'white',
    hoverBg: 'black',
    height: 1,
    right: 11,
    left: sidePanelWidth + labelWidth + 1,
    top: 13,
    name: 'text'
  })

  var buttonClearManifest = blessed.button({
    parent: form,
    top: 13,
    height: 1,
    right: 1,
    width: 9,
    content: ' Clear ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      }
    },
    hoverBg: 'black',
    hoverFg: 'black',
github shobrook / BitVision / bitvision / modals / autotrading.js View on Github external
name: "enable",
    content: "enable",
    style: {
      bg: colorScheme.confirmLight,
      focus: {
        bg: colorScheme.confirmDark,
        fg: "black"
      },
      hover: {
        bg: colorScheme.confirmDark,
        fg: "black"
      }
    }
  });

  var disable = blessed.button({
    parent: toggleForm,
    mouse: true,
    keys: true,
    shrink: true,
    left: 3,
    bottom: 1,
    padding: {
      left: 2,
      right: 2
    },
    name: "disable",
    content: "disable",
    style: {
      bg: colorScheme.cancelLight,
      focus: {
        bg: colorScheme.cancelDark,
github FormidableLabs / nodejs-dashboard / lib / views / goto-time-view.js View on Github external
content: ""
    });

    this.errorText = blessed.text({
      top: 5,
      align: "center",
      width: "100%",
      height: 1,
      content: "",
      style: {
        fg: "red"
      },
      hidden: true
    });

    this.acceptButton = blessed.button({
      top: "100%-3",
      height: 3,
      width: "half",
      name: "accept",
      content: "Accept",
      align: "center",
      style: {
        focus: {
          bg: "green",
          fg: "black"
        },
        border: {
          fg: "green"
        },
        fg: "green"
      },
github heapwolf / lev / lib / ui / connections.js View on Github external
width: 10,
    content: ' Create ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      } 
    },
    hoverBg: 'black',
    autoFocus: false,
    mouse: true,
  })

  var buttonConnect = blessed.button({
    parent: connections,
    bottom: 1,
    height: 1,
    right: 2,
    width: 11,
    content: ' Connect ',
    align: 'center',
    style: {
      bg: 243,
      fg: 'white',
      focus: {
        bg: 'black'
      }
    },
    hoverBg: 'black',
    autoFocus: false,