Hello everyone,
my program is started from the /etc/rc.local file. And the rendering shows some problems.
If I start the same program directly from the Linux shell I don't have these rendering problems.
I added a screenshot that shows the problem. And the problem doesn't only occur in the shown window, but also in other windows. Border are not drawn correctly, text fields are drawn on position on the left border of the screen instead on their normal position.
That is a big issue for me as we will use the program only in the rc.local file.
I'm getting more and more frustrated: I wrote a little C program that does the same as my program + Java Curses Library: It draws a window with the same size and on the same position as in my Java program. And it works perfectly. I'm totally confused.
Here is the line how I compiled the program followed by the source code of the program:
gcc test.c -std=c99 -I/usr/include -L/usr/lib -lncurses -o test
include <ncurses.h>
include <stdio.h>
include <locale.h>
void drawBox(int x, int y, int width, int height, short number, long attr) {
attron(COLOR_PAIR(number) | attr);
move(y, x);
addch(ACS_ULCORNER);
for (int posx = 1; posx < width - 1; posx++) {
addch(ACS_HLINE);
}
addch(ACS_URCORNER);
for (int posy = 1; posy < height - 1; posy++) {
move(y + posy, x);
addch(ACS_VLINE);
move(y + posy, x + width - 1);
addch(ACS_VLINE);
}
move(y + height - 1, x);
addch(ACS_LLCORNER);
for (int posx = 1; posx < width - 1; posx++) {
addch(ACS_HLINE);
}
addch(ACS_LRCORNER);
attroff(COLOR_PAIR(number) | attr);
}
void clearBox(int x, int y, int width, int height, short number, long attr) {
attron(COLOR_PAIR(number) | attr);
for (int posy = 0; posy < height; posy++) {
move(y + posy, x);
for (int posx = 0; posx < width; posx++) {
addch(' ');
}
}
attroff(COLOR_PAIR(number) | attr);
}
void drawString(char str, int x, int y, short number, long attr) {
char ch;
}
int main(int argc, char argv[]) {
int x, y, width, height;
char title = "Welcome\0";
/
* This lines doesn't do a thing if you use Ubuntu Linux.
* But if you replace "UTF-8" with "" you will get some problems.
/
};