Solved

curses to draw a box

Posted on 2004-10-31
271 Views
Last Modified: 2013-12-27
hi experts,

i am trying to draw a closed thick box. however the use of characters like hypens, pipes, or underscore cannot give me a closed thick box.

how?
0
Question by:sonic2000
    6 Comments
     
    LVL 38

    Expert Comment

    by:wesly_chen
    Hi,

        You mean draw a thick box in a text editor like vi?
    How about use "#" instead?

    Wesly
    0
     

    Author Comment

    by:sonic2000
    i need a thick closed border box.
    anyway what does it got to do with the text editor i am using? anyway i am using vim.
    0
     
    LVL 38

    Expert Comment

    by:wesly_chen
    Hi,
     
       vim is advanced version of vi.

       However, with text editor, which deals with ASCII code, it's hard to draw a closed box.
    However, you can use "+" at each corner of the box.

    Wesly
    0
     

    Author Comment

    by:sonic2000
    i read about ACS_BLOCK.
    How to use all those color constants and drawings?
    doesn't seem to work.
    0
     
    LVL 38

    Expert Comment

    by:wesly_chen
    Hi,

       ACS_BLOCK is a parameter for programming fuctions which are defined in ocurses.h.
    It's not for plain text file.

    Wesly
    0
     
    LVL 12

    Accepted Solution

    by:
    Hi sonic2000,
    If you have a colour display, you can use VT220 colour codes (or invert mode for monochrome) to exchange foreground and background colours:

    Colour swapping:
    "\x1b[30;47m"

    Inverse: "\x1b[7m"

    Reset to normal: "\x1b[0m"

    See also http://rtfm.etla.org/xterm/ctlseq.html

    Cheers!

    Stefan
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now