-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
background color issue when resizing a pad #122
Comments
For what it's worth... same test in C (with the same problem). By hitting the up arrow and setting #include <curses.h>
int main( void)
{
int pROWS = 40, pCOLS = 50;
int pad1_position = 0, i, ch = -1;
WINDOW *pad1;
initscr();
cbreak();
noecho();
keypad(stdscr, TRUE);
start_color();
init_pair(1, COLOR_RED, COLOR_WHITE);
refresh();
pad1 = newpad( pROWS,pCOLS);
wbkgd(pad1, COLOR_PAIR(1));
for( i = 0; i < pROWS - 2; i++)
mvwprintw( pad1, i, 2, "%d: This is a TEST LINE", i + 1);
while( ch != 'q' && ch != 'Q')
{
prefresh( pad1, pad1_position, 0, 5, 5, 15, pCOLS-2);
ch = getch();
if( ch == KEY_DOWN) /* MOVING DOWN */
pad1_position++;
else if( ch == KEY_UP) /* MOVING UP */
pad1_position--;
else /* ADDING A LINE AT BOTTOM OF PAD AND MOVING DOWN */
{
int x, y;
pROWS++;
pad1_position++;
getmaxyx(pad1, y, x); /* proof that pad changes size. */
mvwprintw( pad1, 3, 3, "%d hit ", ch);
mvwprintw(pad1,pROWS-2,2, "%d : This is a NEW LINE | mY=%d, mX=%d",
pROWS - 2, y, x);
wresize(pad1,pROWS,pCOLS);
/* wbkgd(pad1, COLOR_PAIR(1)) # <-- this won't fix anything
even if it is before prefresh */
}
}
endwin();
return( 0);
} |
Any idea why this might happening? |
@Bill-Gray I found another very wierd thing... if you do UPDATE | I meant sx1 not sy1 |
Not so far. I tried a few things but got nowhere. |
@GiorgosXou - re "another weird thing" : just to confirm, you are saying that adjusting I haven't figured out the background issue either. A possible clue : it appears to go beyond just pads. Modified version of your test, except applied to the main window, follows. Resize the window, and bits beyond the initial screen size (both horizontal and vertical) are left black. #include <curses.h>
int main( void)
{
initscr();
start_color( );
init_pair(1, COLOR_RED, COLOR_WHITE);
bkgd( COLOR_PAIR( 1));
addstr( "Resize the window. Hit any key to exit.");
refresh();
while( getch( ) == KEY_RESIZE)
resize_term( 0, 0);
endwin( );
return( 0);
} |
@Bill-Gray @wmcbrine my fault i meant |
again sorry for the confusion (my brain not working well right now, i haven't slept that well today, i'm going to rest, if you find anything let me know, thanks) UPDATE 19/10/2021my fault again, it is the same issue but with columns, nothing new |
I am reasonably sure the problem is here, in the
Adding the line |
Thanks 🙏 |
wresize
-ing a pad immediately afterwbkgd
/setting a background-color to it, creates the issue demonstrated above in the image:I've tried looking into the bkgd.c and window.c but i had no luck... (this issue is not present with ncurses)
I use unicurses with the latest 3.9 version of PDCurses
The text was updated successfully, but these errors were encountered: