Type Definition libnotcurses_sys::NcPlaneOptions

source ·
pub type NcPlaneOptions = ncplane_options;
Expand description

Options struct for NcPlane.

It is recommended to construct it via NcPlaneOptionsBuilder by calling NcPlaneOptions::builder().

Fields

  • y: vertical placement relative to parent plane.
  • x: horizontal placement relative to parent plane.
  • rows: vertical length in rows.
  • cols: horizontal length in columns.
  • userptr: optional user curry.
  • name: optional string identifier for debugging.
  • resizecb: callback when parent is resized.
  • margin_b: bottom margin (requires the Marginalized flag).
  • margin_r: right margin (requires the Marginalized).

Implementations§

source§

impl NcPlaneOptions

source

pub fn new(y: i32, x: i32, rows: u32, cols: u32) -> Self

New NcPlaneOptions using the horizontal x.

source

pub fn builder() -> NcPlaneOptionsBuilder

Returns a default NcPlane options builder.

source

pub fn to_builder(&self) -> NcPlaneOptionsBuilder

Returns a builder object from the current NcPlane options.

source

pub fn new_aligned(y: i32, align: impl Into<NcAlign>, rows: u32, cols: u32) -> Self

New NcPlaneOptions with horizontal alignment.

source

pub fn with_flags( y: i32, x: i32, rows: u32, cols: u32, resizecb: Option<NcResizeCb>, flags: impl Into<NcPlaneFlag>, margin_b: u32, margin_r: u32 ) -> Self

New NcPlaneOptions, with flags.

source

pub fn with_flags_aligned( y: i32, align: impl Into<NcAlign>, rows: u32, cols: u32, resizecb: Option<NcResizeCb>, flags: impl Into<NcPlaneFlag> ) -> Self

New NcPlaneOptions, with flags and horizontal alignment.

Note: Already includes the NcPlaneOptions::HORALIGNED flag.

source§

impl NcPlaneOptions

source

pub fn is_veraligned(&self) -> bool

Returns true if it has the VerAligned flag set.

source

pub fn is_horaligned(&self) -> bool

Returns true if it has the HorAligned flag set.

source

pub fn is_marginalized(&self) -> bool

Returns true if it has the Marginalized flag set.

source

pub fn is_fixed(&self) -> bool

Returns true if it has the Fixed flag set.

source

pub fn is_autogrow(&self) -> bool

Returns true if it has the AutoGrow flag set.

source

pub fn is_vscroll(&self) -> bool

Returns true if it has the VScroll flag set.

Trait Implementations§

source§

impl From<&NcPlaneOptionsBuilder> for NcPlaneOptions

source§

fn from(builder: &NcPlaneOptionsBuilder) -> Self

Converts to this type from the input type.
source§

impl From<&mut NcPlaneOptionsBuilder> for NcPlaneOptions

source§

fn from(builder: &mut NcPlaneOptionsBuilder) -> Self

Converts to this type from the input type.
source§

impl From<NcPlaneOptionsBuilder> for NcPlaneOptions

source§

fn from(builder: NcPlaneOptionsBuilder) -> NcPlaneOptions

Converts to this type from the input type.