render () { // var grid = new contrib.grid({rows: 12, cols: 12, screen: this.screen}) // grid.set(row, col, rowSpan, colSpan, obj, opts) // var map = grid.set(0, 0, 4, 4, this.widgetsRepository.get('containerInfo').widget) // var box = grid.set(4, 4, 4, 4, blessed.box, {content: 'My Box'}) // console.log(this.widgetsRepository.get('containerInfo').widget) this.screen.render() }
this.container.key(["?", "h", "S-h"], () => { this.gotoTimeView.hide(); this.helpView.toggle(); this.screen.render(); });
const MockScreen = function MockScreen() { // organized by primitive, Object, stubs, alphabetically Object.assign(this, { program: new MockProgram(), type: "screen", clickable: [], keyable: [], _listenKeys: blessed.screen.prototype._listenKeys, _listenMouse: sandbox.stub(), append: sandbox.stub(), remove: sandbox.stub(), render: sandbox.stub(), restoreFocus: sandbox.stub(), rewindFocus: sandbox.stub(), saveFocus: sandbox.stub(), setEffects: sandbox.stub() }); EventEmitter.call(this); if (stubEvents === undefined || stubEvents) { sandbox.stub(this, "on"); } }
registerEvents () { this.screen.on('keypress', (ch, key) => { if (key && key.name === 'tab') { this.toggleWidgetFocus ? this.widgetsRepository.get('containerLogs').focus() : this.widgetsRepository.get('containerList').focus() this.toggleWidgetFocus = !this.toggleWidgetFocus this.screen.render() this.screen.on('element focus', (curr, old) => { if (old && old.border) { old.style.border.fg = 'default' this.screen.render() }) this.screen.key('q', () => { this.screen.destroy() return process.exit(0) }) this.screen.key('v', () => { this.clearHooks() this.toggleMode() this.screen.destroy() this.init() })
teardown () { this.screen.destroy() }
this.screen.key("C-c", () => { process.kill(process.pid, "SIGINT"); });
this.container.key(["g", "S-g"], () => { this.helpView.hide(); this.gotoTimeView.toggle(); this.screen.render(); });