bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proper Refresh Sequence?


From: Michael B. Allen
Subject: Proper Refresh Sequence?
Date: Sun, 5 Aug 2001 04:35:16 -0400

I'm using a delegation model where a tree of components are rendered
recursively on the fly from a screen definition in an ascii file. I do
not understand how the wrefresh calls are working and where they should
be called. Ideally I'd like to do the recursive drawing and only after
all components have mvwaddch'd or mvwaddstr'd or whatever would I call
wrefresh. But this doesn't seem to be working. I have found that I must
call refresh and then wrefresh for each window (I think). I have tried so
many permutations and yet I still don't understand what is happening. I
can see the screen flashing up and then dissapearing. Very frustrating.

A tree might look like this:

COMPONENT       WINDOW
root            stdscr
  frame         newwin1
    text        (uses parent's window newwin1)
  frame         newwin2
    text        (uses parent's window newwin2)
    button      (uses parent's window newwin2)
  text          stdscr

So I create new windows for frames into which text, buttons, and soon
fields, menus and so on can be rendered. To display the entire lot I
call draw(root) and it calls draw(frame) which calls draw(text), etc.

What would be the proper sequence of refresh, wrefresh, touchwin,
wsyncdown, doupdate or whatever to get this to work properly and
efficiently?

Mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]