{"action":"created","issue":{"url":"https://api.github.com/repos/chjj/blessed/issues/252","repository_url":"https://api.github.com/repos/chjj/blessed","labels_url":"https://api.github.com/repos/chjj/blessed/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/chjj/blessed/issues/252/comments","events_url":"https://api.github.com/repos/chjj/blessed/issues/252/events","html_url":"https://github.com/chjj/blessed/issues/252","id":162200416,"number":252,"title":"Scrollable box example","user":{"login":"keevitaja","id":158787,"avatar_url":"https://avatars.githubusercontent.com/u/158787?v=3","gravatar_id":"","url":"https://api.github.com/users/keevitaja","html_url":"https://github.com/keevitaja","followers_url":"https://api.github.com/users/keevitaja/followers","following_url":"https://api.github.com/users/keevitaja/following{/other_user}","gists_url":"https://api.github.com/users/keevitaja/gists{/gist_id}","starred_url":"https://api.github.com/users/keevitaja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keevitaja/subscriptions","organizations_url":"https://api.github.com/users/keevitaja/orgs","repos_url":"https://api.github.com/users/keevitaja/repos","events_url":"https://api.github.com/users/keevitaja/events{/privacy}","received_events_url":"https://api.github.com/users/keevitaja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-24T18:07:02Z","updated_at":"2016-08-31T01:36:25Z","closed_at":null,"body":"Hi,\r\n\r\ni cannot figure this thing out. How can i create a scrollable box? \r\n\r\n```\r\n\"use strict\";\r\n\r\nconst blessed = require('blessed');\r\n\r\nconst config = require('./config.js');\r\n\r\nconst screen = process.mud.screen;\r\nconst prompt = process.mud.prompt;\r\n\r\nconst box = blessed.ScrollableBox(config.options);\r\n\r\nscreen.append(box);\r\n\r\nprompt.on('input', (data)=> {\r\n    box.setText(data);\r\n    box.screen.render();\r\n});\r\n\r\nfor (let i = 0; i < 200; i++) {\r\n    box.insertLine(0, 'texting ' + i);\r\n    box.screen.render();\r\n}\r\n\r\nscreen.on('keypress', ()=> {\r\n    console.log('test');\r\n    box.scroll(10);\r\n});\r\n```\r\n\r\nAnd this is not working at all. Any help?"},"comment":{"url":"https://api.github.com/repos/chjj/blessed/issues/comments/243633480","html_url":"https://github.com/chjj/blessed/issues/252#issuecomment-243633480","issue_url":"https://api.github.com/repos/chjj/blessed/issues/252","id":243633480,"user":{"login":"Anaerin","id":989271,"avatar_url":"https://avatars.githubusercontent.com/u/989271?v=3","gravatar_id":"","url":"https://api.github.com/users/Anaerin","html_url":"https://github.com/Anaerin","followers_url":"https://api.github.com/users/Anaerin/followers","following_url":"https://api.github.com/users/Anaerin/following{/other_user}","gists_url":"https://api.github.com/users/Anaerin/gists{/gist_id}","starred_url":"https://api.github.com/users/Anaerin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anaerin/subscriptions","organizations_url":"https://api.github.com/users/Anaerin/orgs","repos_url":"https://api.github.com/users/Anaerin/repos","events_url":"https://api.github.com/users/Anaerin/events{/privacy}","received_events_url":"https://api.github.com/users/Anaerin/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T01:36:25Z","updated_at":"2016-08-31T01:36:25Z","body":"To always scroll to the bottom (which is something else I came across - in theory \"alwaysScroll: true\" should do it, but it isn't. So I'm doing:\r\n````JavaScript\r\n\tbody.pushLine(output);\r\n\tbody.setScrollPerc(100);\r\n\tscreen.render();\r\n````\r\nWhich seems to do the job AOK. It will mean that scrolling up to review will get negated any time a new line comes in, but I'm sure you could handle that elsewhere."}}
{"actor":{"display_login":"Anaerin"}}