From: noemail@basdxcqvbe.com   
      
   On Wed, 14 Jul 2021 14:56:31 +0100   
   James Harris wrote:   
      
   > Is there already a good standard way to interface with a textual   
   > display? What I'm looking for is a pre-defined set of calls which I   
   > can just implement rather than having to design from scratch.   
   >   
   > For example,   
   >   
   > * calls to manage display windows   
   > * calls to manage widgets which go in those windows   
   > * options, for example what to do when a line of text would extend   
   > past the right-hand side of the available space (wrap or not), how to   
   > render a window's borders, what controls a window should have, how   
   > elements should be placed within windows, etc   
   >   
   > AISI there are naturally:   
   >   
   > Windows which are populated with various widgets   
   >   
   > Widgets of various types, each having its own behaviour, which are   
   > placed in windows.   
   >   
   > To implement a terminal perhaps a widget could provide a scrollable   
   > view into a text buffer with an input field at the bottom. Not sure.   
   >   
   > Ideally, the calls would work whether they were interacting with a   
   > TUI or a GUI so I guess I could follow a GUI standard. But I suspect   
   > that that's getting rather complicated. :-(   
   >   
   > Any suggestions?   
   >   
      
   On DOS, I coded this stuff myself using the DOS specific    
   functions. When I ported one DOS app to Linux, I needed to the   
    functions as there was no for Linux.   
      
   So, for *nix, there is the "curses" text GUI library, e.g., ncurses.   
   There is also the public-domain version, i.e., pdcurses, for DOS etc.   
      
   https://en.wikipedia.org/wiki/Curses_(programming_library)   
   https://en.wikipedia.org/wiki/Ncurses   
   https://en.wikipedia.org/wiki/PDCurses   
      
   To link on Linux,   
   gcc -lcurses   
      
   To use,   
   #include    
      
   Of course, like any graphics library, you have to call all sorts of set   
   up functions, exit functions, and do a myriad of other stuff ... You'll   
   need to locate a decent programming guide. E.g. found this for ncurses   
   via Google:   
      
   NCURSES Programming HOWTO   
   https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/   
      
      
   --   
   The Chinese have such difficulty with English ... The word is not   
   "reunification" but "revenge".   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|