Add a scrollbar on Ncurses or make it like "more"

Asked
Active3 hr before
Viewed126 times

3 Answers

scrollbar
90%

Thanks for the both answers.. I appreciate it.. I am still debating whether creating a buffer mechanism for Ncurses will be easier than implement a client like "more" ... by more I mean user should be able to type in command at the bottom while server is dumping log.. Currently I have two threads on dumps log in the top sub window and other takes command input at the bottom... – Shawn Jul 7 '11 at 22:20 ,Assuming your ncurses is compiled with Unicode support (remember to set the environment correctly when initializing ncurses, look into "setlang"), you can use following characters:,I'm not entirely sure if you are asking about how to implement scrollback or how to draw a scrollbar with ncurses. My guess is the second.,If you maintain a list or array of lines in your client and ask ncurses to paint a range of lines as a sliding window, you can slide your window up and down in response to ^F ^B ^U ^D ^Y ^E commands, which just repaints the screen with different indexes.

Assuming your ncurses is compiled with Unicode support (remember to set the environment correctly when initializing ncurses, look into "setlang"), you can use following characters:

Unicode: ▲-U + 25 B2 BLACK UP - POINTING TRIANGLE▼ - U + 25 BC BLACK DOWN - POINTING TRIANGLE▮ - U + 25 AE BLACK VERTICAL RECTANGLE

ASCII:
   176 - ░Light shaded block
177 - ▒Medium shaded block
178 - ▓Dark shaded block
219 - █Block block
88%

Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues ,Read the question carefully.,View Unanswered Questions,Most Valuable Professionals

72%

The addch() methods take a character, which can be either a string of length 1, a bytestring of length 1, or an integer.,Move to position y,x within the window, and display str or ch, using attribute attr,Windows are the basic abstraction in curses. A window object represents a rectangular area of the screen, and supports methods to display text, erase it, allow the user to input strings, and so forth.,This document describes how to use the curses extension module to control text-mode displays.

import curses
stdscr = curses.initscr()
load more v

Other "scrollbar-undefined" queries related to "Add a scrollbar on Ncurses or make it like "more""