Boxline in curses ( Linux )

M

M.Senthil Kumar

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
 
J

Jack Klein

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

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

For Linux programming, ask in
 
N

nrk

M.Senthil Kumar said:
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

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
 
D

Derk Gwen

# 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.
 
M

Malcolm

Derk Gwen said:
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.
 
A

August Derleth

Malcolm said:
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.

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.
 
D

Derk Gwen

#
# > 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.
 
R

Richard Bos

Derk Gwen said:
#
# > 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;

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top