curses.panel --- curses のためのパネルスタック拡張


パネルは深さ (depth) の機能が追加されたウィンドウです。これにより、ウィンドウをお互いに重ね合わせることができ、各ウィンドウの可視部分だけが表示されます。パネルはスタック中に追加したり、スタック内で上下移動させたり、スタックから除去することができます。

関数

The module curses.panel defines the following exception:

exception curses.panel.error

Exception raised when a curses panel library function returns an error.

The module curses.panel defines the following functions:

curses.panel.bottom_panel()

パネルスタックの最下層のパネルを返します。

curses.panel.new_panel(win)

Returns a panel object, associating it with the given window win and placing the new panel on top of the panel stack. 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()

パネルスタックの最上層のパネルを返します。

curses.panel.update_panels()

仮想スクリーンをパネルスタック変更後の状態に更新します。この関数では curses.doupdate() を呼ばないので、ユーザは自分で呼び出す必要があります。

Panel objects

class curses.panel.panel

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 オブジェクトは以下のメソッドを持っています:

panel.above()

現在のパネルの上にあるパネルを返します。

panel.below()

現在のパネルの下にあるパネルを返します。

panel.bottom()

パネルをスタックの最下層にプッシュします。

panel.hidden()

パネルが隠れている (不可視である) 場合に True を返し、そうでない場合 False を返します。

panel.hide()

パネルを隠します。この操作ではオブジェクトは消去されず、スクリーン上のウィンドウを不可視にするだけです。

panel.move(y, x)

パネルをスクリーン座標 (y, x) に移動します。

panel.replace(win)

パネルに関連付けられたウィンドウを win に変更します。

panel.set_userptr(obj)

パネルのユーザポインタを obj に設定します。このメソッドは任意のデータをパネルに関連付けるために使われ、任意の Python オブジェクトにすることができます。

panel.show()

Display the panel (which might have been hidden), placing it on top of the panel stack.

panel.top()

パネルをスタックの最上層にプッシュします。

panel.userptr()

パネルのユーザポインタを返します。任意の Python オブジェクトです。

panel.window()

パネルに関連付けられているウィンドウオブジェクトを返します。