Struct pancurses::Window [] [src]

pub struct Window { /* fields omitted */ }

Methods

impl Window
[src]

[src]

Adds the chtype ch to the window at the current cursor position, and advances the cursor.

Note that chtypes can convey both text (a single character) and attributes, including a color pair.

[src]

Write all the characters of the string to the given window.

The functionality is similar to calling window.addch() once for each character in the string.

[src]

Write at most length characters; if length is negative, then the entire string will be added.

[src]

Retrieve attributes for the given window.

use pancurses::{A_BOLD, initscr, endwin};
let window = initscr();
window.attron(A_BOLD);
let (active_attributes, color_pair) = window.attrget();
assert_eq!(A_BOLD, active_attributes);
endwin();

[src]

Turns off the named attributes without affecting any other attributes.

[src]

Turns on the named attributes without affecting any other attributes.

[src]

Sets the current attributes of the given window to attributes.

[src]

Not only change the background, but apply it immediately to every cell in the window.

[src]

Manipulate the background of a window. The background is a chtype consisting of any combination of attributes and a character; it is combined with each chtype added or inserted to the window by addch() or insch(). Only the attribute part is used to set the background of non-blank characters, while both character and attributes are used for blank positions.

[src]

Draw a border around the edges of the window.

[src]

Changes the attributes of a given number of characters starting at the current cursor location. It does not update the cursor and does not perform wrapping. A character count of -1 or greater than the remaining window width means to change attributes all the way to the end of the current line.

[src]

Similar to erase(), but also calls clearok() to ensure that the the window is cleared on the next refresh().

[src]

With clearok(), if bf is TRUE, the next call to refresh() with this window will clear the screen completely and redraw the entire screen.

[src]

Clear the window from the current cursor position to the end of the window.

[src]

Clear the window from the current cursor position to the end of the current line.

[src]

Sets the current color of the given window to the foreground/background combination described by the color pair parameter.

[src]

Copy all text from this window to the destination window. The arguments src_tc and src_tr specify the top left corner of the region to be copied. dst_tc, dst_tr, dst_br, and dst_bc specify the region within the destination window to copy to. The argument "overlay", if TRUE, indicates that the copy is done non-destructively (as in overlay()); blanks in the source window are not copied to the destination window. When overlay is FALSE, blanks are copied.

[src]

Delete the character under the cursor. All characters to the right of the cursor on the same line are moved to the left one position and hte last character on the line is filled with a blank. The cursor position does not change.

[src]

Delete the line under the cursor. All lines below are moved up one line, and the bottom line is cleared. The cursor position does not change.

[src]

Deletes the window, freeing all associated memory. In the case of overlapping windows, subwindows should be deleted before the main window.

[src]

The same as subwin(), except that begy and begx are relative to the origin of the window rather than the screen.

There is no difference between subwindows and derived windows.

[src]

Draw a border around the edge of the window. If any argument is zero, an appropriate default is used.

[src]

Copies blanks (i.e. the background chtype) to every cell of the window.

[src]

Get the upper-left y coordinate of this window

[src]

[src]

Get the upper-left y and x coordinates of this window

[src]

Returns the given window's current background character and attributes.

[src]

Read a character from the terminal associated with the window.

In nodelay mode, if there is no input waiting, None is returned. In delay mode, the program will hang until the system passes text through to the program. Depending on the setting of cbreak(), this will be after one character or after the first newline. Unless noecho() has been set, the character will also be echoed into the designated window.

If keypad() is TRUE, and a function key is pressed, the token for that function key will be returned instead of the raw characters. If nodelay(win, TRUE) has been called on the window and no input is waiting, None is returned.

[src]

Return the current x coordinate of the cursor

[src]

Return the current y coordinate of the cursor

[src]

Return the current y and x coordinates of the cursor

[src]

Return the maximum x value of this Window, in other words the number of columns.

[src]

Return the maximum y value of this Window, in other words the number of rows.

[src]

Return the maximum y and x value of this Window

[src]

Draw a horizontal line using ch from the current cursor position. The line is at most n characters long, or as many as fit into the window.

[src]

Controls whether getch() returns function/special keys as single key codes (e.g., the left arrow key as KEY_LEFT).

Per X/Open, the default for keypad mode is OFF. You'll probably want it on. With keypad mode off, if a special key is pressed, getch() does nothing or returns ERR.

[src]

Insert the character ch before the character under the cursor.

All characters to the right of the cursor are moved one space to the right, with the possibility of the rightmost character on the line being lost. The insertion operation does not change the cursor position.

[src]

The cursor associated with the window is moved to the given location.

This does not move the physical cursor of the terminal until refresh() is called. The position specified is relative to the upper left corner of the window, which is (0,0).

[src]

moves the cursor to the specified position and adds ch to the specified window

[src]

Write all the characters of the string str to the given window. The functionality is similar to calling waddch() once for each character in the string.

[src]

Write the first'n' characters of the string str to the given window.

[src]

Moves the cursor and changes the attributes of a given number of characters starting at the cursor location. It does not update the cursor and does not perform wrapping. A character count of -1 or greater than the remaining window width means to change attributes all the way to the end of the current line.

[src]

Retrieves the character and attribute from the specified window position, in the form of a chtype.

[src]

Move the cursor and then insert the character ch before the character under the cursor.

First performs a cursor movement using wmove, and returns an error if the position is outside the window. All characters to the right of the cursor are moved one space to the right, with the possibility of the rightmost character on the line being lost. The insertion operation does not change the cursor position.

[src]

Add a string to the window at the specified cursor position.

[src]

Controls whether wgetch() is a non-blocking call. If the option is enabled, and no input is ready, wgetch() will return ERR. If disabled, wgetch() will hang until input is ready.

[src]

Copies the window to the virtual screen.

[src]

Overlays this window on top of destination_window. This window and destination_window are not required to be the same size; only text where the two windows overlap is copied. overlay() is non-destructive.

[src]

Overlays this window on top of destination_window. This window and destination_window are not required to be the same size; only text where the two windows overlap is copied. overwrite() is destructive.

[src]

Add a string to the window at the current cursor position.

[src]

Copies the named window to the physical terminal screen, taking into account what is already there in order to optimize cursor movement.

This function must be called to get any output on the terminal, as other routines only manipulate data structures. Unless leaveok() has been enabled, the physical cursor of the terminal is left at the location of the window's cursor.

[src]

If enabled and a scrolling region is set with setscrreg(), any attempt to move off the bottom margin will cause all lines in the scrolling region to scroll up one line.

[src]

Sets a scrolling region in a window.

"top" and "bot" are the line numbers for the top and bottom margins.

[src]

Creates a new subwindow within a window.

The dimensions of the subwindow are nlines lines and ncols columns. The subwindow is at position (begy, begx) on the screen. This position is relative to the screen, and not to the window orig. Changes made to either window will affect both. When using this routine, you will often need to call touchwin() before calling wrefresh().

[src]

Set blocking or non-blocking reads for the specified window.

The delay is measured in milliseconds. If it's negative, a blocking read is used; if zero, then non-blocking reads are done -- if no input is waiting, ERR is returned immediately. If the delay is positive, the read blocks for the delay period; if the period expires, ERR is returned.

[src]

Places ch back onto the input queue to be returned by the next call to getch().

[src]

Draw a vertical line using ch from the current cursor position. The line is at most n characters long, or as many as fit into the window.

Trait Implementations

impl Debug for Window
[src]

[src]

Formats the value using the given formatter.