curses.panel — A panel stack extension for curses - Python 3.11.1 documentation 编辑


Panels are windows with the added feature of depth, so they can be stacked on top of each other, and only the visible portions of each window will be displayed. Panels can be added, moved up or down in the stack, and removed.

Functions

The module curses.panel defines the following functions:

curses.panel.bottom_panel()

Returns the bottom panel in the panel stack.

curses.panel.new_panel(win)

Returns a panel object, associating it with the given window win. Be aware that you need to keep the returned panel object referenced explicitly. If you don’t, the panel object is garbage collected and removed from the panel stack.

curses.panel.top_panel()

Returns the top panel in the panel stack.

curses.panel.update_panels()

Updates the virtual screen after changes in the panel stack. This does not call curses.doupdate(), so you’ll have to do this yourself.

Panel Objects

Panel objects, as returned by new_panel() above, are windows with a stacking order. There’s always a window associated with a panel which determines the content, while the panel methods are responsible for the window’s depth in the panel stack.

Panel objects have the following methods:

Panel.above()

Returns the panel above the current panel.

Panel.below()

Returns the panel below the current panel.

Panel.bottom()

Push the panel to the bottom of the stack.

Panel.hidden()

Returns True if the panel is hidden (not visible), False otherwise.

Panel.hide()

Hide the panel. This does not delete the object, it just makes the window on screen invisible.

Panel.move(y, x)

Move the panel to the screen coordinates (y, x).

Panel.replace(win)

Change the window associated with the panel to the window win.

Panel.set_userptr(obj)

Set the panel’s user pointer to obj. This is used to associate an arbitrary piece of data with the panel, and can be any Python object.

Panel.show()

Display the panel (which might have been hidden).

Panel.top()

Push panel to the top of the stack.

Panel.userptr()

Returns the user pointer for the panel. This might be any Python object.

Panel.window()

Returns the window object associated with the panel.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:45 次

字数:2922

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文