Ncurses的:doupdate之差()和刷新()的面板 [英] Ncurses: Difference between doupdate() and refresh() for panels

查看:670
本文介绍了Ncurses的:doupdate之差()和刷新()的面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 doupdate之间的差值()刷新()

看来,刷新()可以取代 doupdate(),但文本不会出现,除非刷新()被调用。

It appears that refresh () can be substituted for doupdate(), however text does not appear unless refresh() is called.

此外,没有刷新()刷新所有的窗口,还是应该刷新()堪称为每一个窗口,这是一个面板内?

Also, does refresh() refresh all the windows, or should refresh() be called for every window, that is inside a panel?

推荐答案

从丹Gookin的<一个href=\"http://books.google.com/books/about/Programmer_s_Guide_to_NCurses.html?id=Htff8VRO-UEC&redir_esc=y\"相对=nofollow> 程序员指南NCURSES 的(页513):

From Dan Gookin's Programmer's Guide to NCurses (page 513):

在NCURSES刷新操作由两部分组成:

The refresh operation in NCurses consists of two parts:


      
  • 首先,需要的ncurses已经改变或触动一个窗口的那些部分,并从窗口数据写入结果那部分
      结构,以在存储器中的虚拟屏幕。

  •   
  • 二,自上次刷新触及虚拟屏幕的内容显示在终端上。

  •   

的信息从一个窗口的数据结构,以虚拟复印
  画面由wnoutrefresh()函数进行的。的更新
  虚拟屏幕的终端是由另一功能处理,
  doupdate()。它们一起形成一个刷新的两个分量()或
  wrefresh()调用。

The copying of information from a window data structure to the virtual screen is carried out by the wnoutrefresh() function. The updating of the virtual screen to the terminal is handled by another function, doupdate(). Together they form the two components of a refresh() or wrefresh() call.

使用wnoutrefresh()的优势是,当
  更新多个窗口。在这种情况下,重复呼叫
  wnoutrefresh()后跟一个赎罪GLE doupdate()调用更多
  效率比一系列wrefresh()来电,再加上它会导致更少
  闪烁。

The advantage of using wnoutrefresh() comes when updating multiple windows. In that case, repeated calls to wnoutrefresh() followed by a sin- gle doupdate() call is more efficient than a series of wrefresh() calls, plus it results in less flicker.

至于面板而言,他们是那种包装到窗口(因此每个小组都有一个确切的窗口)。它应该是足以叫 update_panels()(其中写入窗口虚拟屏幕由面板给出正确的堆叠顺序),然​​后 doupdate ()来输出虚拟屏幕到终端。

As far as panels are concerned, they are sort of wrappers to windows (so each panel has exactly one window). It should be enough to call update_panels() (which writes the windows to the virtual screen in the correct stacking order given by the panels) and then doupdate() to output virtual screen to the terminal.

如果你想进一步划分您的面板,可以考虑使用子窗口。

If you want to further divide your panels, consider using subwindows.

这篇关于Ncurses的:doupdate之差()和刷新()的面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆