Boxline in curses ( Linux )

Discussion in 'C Programming' started by M.Senthil Kumar, Feb 21, 2004.

  1. hai all,
    I need a help from you. I 'm working in a project using "curses.h" in
    Linux using 'C'. I have some doughts regarding menus and line.
    1. I used to draw box in window using ACS_HLINE,ACS_VLINE. But what
    happened is, the line is not a straight line. Instead of that it look
    continus hypen ( - ) for HLINE and continuous ( | ) for VLINE.
    I'm using curses version : 5.3.20030118 came along with RedHat 9.0 .
    Please tellme how to draw straight line. ( It is working correctly
    in version : 5.2.20020406 come along with RedHat 7.3 )

    thanks,
    Senthil kumar.M
     
    M.Senthil Kumar, Feb 21, 2004
    #1
    1. Advertisements

  2. M.Senthil Kumar

    Jack Klein Guest

    This group discusses the standard C language, which does not include
    third party libraries and extensions like curses.

    For Linux programming, ask in
     
    Jack Klein, Feb 21, 2004
    #2
    1. Advertisements

  3. M.Senthil Kumar

    nrk Guest

    Your question is not topical in this group as we primarily discuss the C
    language as described in the ANSI/ISO standards. Here are some groups
    where you might find better guidance:

    comp.unix.programmer
    comp.os.linux.development.apps
    comp.os.linux.development

    Please do read their FAQs before posting though. You can find the FAQ for
    comp.lang.c at:
    http://www.eskimo.com/~scs/C-faq/top.html

    -nrk
     
    nrk, Feb 21, 2004
    #3
  4. M.Senthil Kumar

    Derk Gwen Guest

    # 1. I used to draw box in window using ACS_HLINE,ACS_VLINE. But what
    # happened is, the line is not a straight line. Instead of that it look
    # continus hypen ( - ) for HLINE and continuous ( | ) for VLINE.

    An inherent aspect of curses is that it is intended to draw only ASCII
    character on a rectangular grid on a terminal or terminal emulator. If
    you want fancier graphics, you're going to need X-Windows or OpenGL.
    X-Windows should be available on most Linux installs.
     
    Derk Gwen, Feb 21, 2004
    #4
  5. M.Senthil Kumar

    Malcolm Guest

    ASCII characters are basically Latin alphanumerics, a bit of punctuation,
    and a few non-printed controls. However most terminals have an extended
    8-bit character set, the ANSI set, which includes characters designed for
    simple boxes and menus and the like. I would be surprised if curses doesn't
    support these.
     
    Malcolm, Feb 21, 2004
    #5
  6. ANSI characters can be drawn, but once you set the high bit you lose
    portability to systems that don't support ANSI. The DOS terminals come
    to mind, as they still have graphical characters in the `extended ASCII'
    codepoints. Which is a fairly dumb idea in this day and age, but, then,
    so's DOS.
     
    August Derleth, Feb 21, 2004
    #6
  7. M.Senthil Kumar

    Derk Gwen Guest

    #
    # > An inherent aspect of curses is that it is intended to draw only ASCII
    # > character on a rectangular grid on a terminal or terminal emulator. If
    # > you want fancier graphics, you're going to need X-Windows or
    # > OpenGL.
    # > X-Windows should be available on most Linux installs.
    # >
    # ASCII characters are basically Latin alphanumerics, a bit of punctuation,
    # and a few non-printed controls. However most terminals have an extended
    # 8-bit character set, the ANSI set, which includes characters designed for
    # simple boxes and menus and the like. I would be surprised if curses doesn't
    # support these.

    curses was originally written when signedness of C char was subject to
    speculation; only codes 0 through 127 could be used portably; and those
    were the only available codes on the terminals then targetted. Programs
    like vi did (do?) use the extra bit for other purposes. I don't know how
    curses has evolved: I wouldn't trust it with codes 128 through 255 without
    clear documentation that it could handle those.

    Also codes 128 through 255 have wildly different interpretations on
    different machines, a chaos slowly being colonised with Unicode.
     
    Derk Gwen, Feb 22, 2004
    #7
  8. M.Senthil Kumar

    Richard Bos Guest

    This is still true. Plain char may be either signed or unsigned. OTOH,
    on the systems where curses is available, it's likely to be signed.

    Richard
     
    Richard Bos, Feb 23, 2004
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.