pub struct Window { /* private fields */ }
Expand description

A curses window.

It will clean up itself on destruction.

Many curses functions have been renamed for one reason or another. All renamed functions state the curses function they corollate to.

Implementations

Put a character at the point.

This corresponds to addch.

Put a string at the point.

This corresponds to addch.

Print a formatted string at the point.

This corresponds to printw. It does not use printw under the hood because that function cannot be safe to use within rust code because rust does not allow for variadic arguments.

Put the contents of window that overlap with this Window.

The two Windows are not required to be the same size; overlapping portions are copied.

This corresponds to overwrite but with the arguments flipped.

Put the non-blank contents of window that overlap with this Window.

The two Windows are not required to be the same size; overlapping portions are copied.

This corresponds to overlay but with the arguments flipped.

Get the attributes of the character at the point.

This corresponds to attrget.

Turn off the following attributes of the character at the point.

This corresponds to attroff.

Turn on the following attributes of the character at the point.

This corresponds to attron.

Set the attributes of the character at the point.

This corresponds to attrset.

Turn off the following attributes of the character at the point.

This corresponds to chgat.

Set the background of the Window.

This corresponds to bkgdset.

Set the background of the Window and apply it.

This sets the attributes of every character to the attributes of background and replaces old background characters with background.

This corresponds to bkgd.

Clear the screen.

This fills the screen with background characters. This can be customized via set_background.

Unlike erase, clear will also invoke refresh_force_clear.

Clear the virtual screen.

See clear for a comparison of these two methods.

Erase all characters after the point.

This will clear to the end of the line, then clear each line after the one the point is on.

This corresponds to clrtobot.

Erase all characters to the right of the point on this line.

This corresponds to clrtobot.

Set the current color of the given window to the foregrond/background pair color_pair.

This corresponds to color_set.

Copy this Window on top of the destination non-destructively.

For more information on how this works, see overlay.

This corresponds to copywin with a final argument of true.

Copy this Window on top of the destination destructively.

For more information on how this works, see overwrite.

This corresponds to copywin with a final argument of true.

Delete the character at the point.

This will shift left the characters on the rest of the line.

This corresponds to delch.

Delete the line the point is on.

This will shift left the characters on the rest of the line.

This corresponds to delch.

Delete this Window, allowing for error handling outside of panicking.

Draw a border around the edges of the Window.

This corresponds to border.

Drow a box around the edges of the Window.

This is shorthand for draw_border with default corners.

This corresponds to border.

Draw a horizontal line starting at the point.

This corresponds to hline.

Draw a vertical line starting at the point.

This corresponds to vline.

Test if p is enclosed in this Window.

Get the start of the Window on the physical screen.

This corresponds to get_beg_yx.

Get the ending of the Window on the physical screen.

Get the position of the point.

This corresponds to get_cur_yx.

Get the size of the Window.

This corresponds to get_max_yx.

Insert n blank lines above the cursor.

If n > 0, then n blank lines are inserted above the cursor. The last n lines of the screen are lost.

If n < 0, then n lines below the cursor are deleted and the rest are shifted up. This clears the bottom n lines of the screen.

The point remains the same after this operation.

This corresponds to insdelln.

Insert a blank line above the current line.

This effectively erases the last line on the screen.

The point remains the same after this operation.

This corresponds to insertln.

Insert a character into the current line.

This shifts to the right characters after the cursor. The rightmost character will thus be lost.

The point remains the same after this operation.

This corresponds to insch.

Transform the point p from Window-relative to screen-relative.

This corresponds to mouse_trafo.

Transform the point p from screen-relative to Window-relative.

This corresponds to mouse_trafo.

Move to the point to p.

This corresponds to mv.

Move to the point p then put ch at that point.

This corresponds to mvaddch.

Move to the point p then put string at that point.

This corresponds to mvaddstr.

Move to the point p then change the attributes of n characters after that point.

This corresponds to mvchgat.

Move to p then get the character at the point.

This corresponds to mvinch.

Move to p then insert the character at the point.

This corresponds to mvinsch.

Move the Window such that it starts at p on the screen.

This corresponds to mvwin.

Read a key event from the Window.

The exact behavior of this procedure depends on other configuration procedures.

This corresponds to getch.

Place input into the front of the input queue.

Thus the next call to read_char will return input.

This corresponds to ungetch.

Set whether [read_char] will block until an input is ready.

With an argument true, [read_char] will block until it receives an input to yield.

With an argument false, [read_char] will immediately return None if there is no input to yield.

This corresponds to nodelay(!block).

[read_char] will block for at most duration and wait for input.

duration is rounded down to the nearest millisecond. This will only change the way input is read in this Window. To set it for all Windows, see Curses::set_timeout.

From reading the ncurses source code, I have deduced that this is overriden by the global Curses’s timeout (see Curses::set_timeout).

Use None as the timeout to stop this.

This corresponds to timeout.

Enable or disable function key interpolation.

When enabled and a function key is pressed, read_char will return a single value representing the function key instead of a series of escape sequences.

When disabled and a function key is pressed, read_char will return a series of escape sequences instead of a single value representing the function key.

It is disabled by default.

This corresponds to keypad.

Copy this Window to the physical screen.

This corresponds to wrefresh.

Refresh the virtual screen.

This is much faster if multiple Windows have to be refreshed.

To push the virtual screen changes to the physical screen, use Curses::update.

This corresponds to wnoutrefresh.

Make the next call to refresh clear and then rerender.

This corresponds to clearok.

Enable or disable scrolling.

This corresponds to scrollok.

Set a software scrolling region.

This will do nothing unless scrolling has been enabled (see set_scroll_enabled).

This corresponds to setscrreg.

Create a new window

This corresponds to subwin. Note that the arguments have been reordered to be more consistent with other functions.

Test if this Window has been modified since the last call to refresh.

This corresponds to is_wintouched.

Test if the specified line has been modified since the last call to refresh.

This corresponds to is_linetouched.

Force the entire Window to be redrawn upon the next call to refresh.

This corresponds to touchwin.

Force the specified lines to be redrawn upon the next call to refresh.

This corresponds to touchline.

Pretend this Window hasn’t changed and thus won’t redraw it upon the next call to refresh.

This corresponds to touchline.

Pretend the specified lines haven’t changed and thus won’t redraw it upon the next call to refresh.

This corresponds to touchline.

Trait Implementations

Duplicate this Window.

This corresponds to dupwin.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.