Like Tree3Likes
  • 3 Post By mariostg

How to clear ncurses window from (n, n) to (n, n)?

This is a discussion on How to clear ncurses window from (n, n) to (n, n)? within the C Programming forums, part of the General Programming Boards category; Hello friends, Is there any way to clear ncurses window created with newwin() or subwin() from (row, col) to (row, ...

  1. #1
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43

    How to clear ncurses window from (n, n) to (n, n)?

    Hello friends,

    Is there any way to clear ncurses window created with newwin() or subwin() from (row, col) to (row, col),

    Please help.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    Well if there is nothing obvious in the manual page (did you check?), it's not going to be that hard to write a couple of loops to clear a sub-rectangle.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43
    Quote Originally Posted by Salem View Post
    Well if there is nothing obvious in the manual page (did you check?), it's not going to be that hard to write a couple of loops to clear a sub-rectangle.
    I tried with clrtoeol and clrtobot but no success.
    Will you please tell me with some example.

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Ravi Raj, I sincerly think you should read more and ask less. It could be as simple as a loop of mvwaddstr with an str fill up with as many blank characters to match the width of your window area that requires erasing.

  5. #5
    Registered User
    Join Date
    May 2012
    Posts
    2
    well i think it should have worked with cleartoeol() . But u can also use clear(win) and then move(n,n). And don't forget to use wrefresh(win). Hope this helps....

  6. #6
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43

    Thanks...

    Quote Originally Posted by mariostg View Post
    Ravi Raj, I sincerly think you should read more and ask less. It could be as simple as a loop of mvwaddstr with an str fill up with as many blank characters to match the width of your window area that requires erasing.
    Thanks mario for your instructions and I will remember your suggestions from next time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console window won't clear past app
    By LLINE in forum C++ Programming
    Replies: 4
    Last Post: 03-09-2009, 06:01 AM
  2. Ncurses Lib
    By lautarox in forum C Programming
    Replies: 6
    Last Post: 09-24-2008, 06:12 PM
  3. Ncurses or not?
    By Zarniwoop in forum C Programming
    Replies: 4
    Last Post: 05-04-2008, 11:19 AM
  4. ncurses window problem
    By fronty in forum Linux Programming
    Replies: 3
    Last Post: 09-22-2007, 09:33 AM
  5. Ncurses and WINDOW scrolling
    By birkoss in forum Linux Programming
    Replies: 0
    Last Post: 05-17-2002, 11:47 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21