Type Alias 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 theMarginalized
flag).margin_r
: right margin (requires theMarginalized
).
Aliased Type§
struct NcPlaneOptions {
pub y: i32,
pub x: i32,
pub rows: u32,
pub cols: u32,
pub userptr: *mut c_void,
pub name: *const i8,
pub resizecb: Option<unsafe extern "C" fn(_: *mut ncplane) -> i32>,
pub flags: u64,
pub margin_b: u32,
pub margin_r: u32,
}
Fields§
§y: i32
vertical placement relative to parent plane
x: i32
horizontal placement relative to parent plane
rows: u32
rows, must be >0 unless NCPLANE_OPTION_MARGINALIZED
cols: u32
columns, must be >0 unless NCPLANE_OPTION_MARGINALIZED
userptr: *mut c_void
user curry, may be NULL
name: *const i8
name (used only for debugging), may be NULL
resizecb: Option<unsafe extern "C" fn(_: *mut ncplane) -> i32>
callback when parent is resized
flags: u64
closure over NCPLANE_OPTION_*
margin_b: u32
margins (require NCPLANE_OPTION_MARGINALIZED)
margin_r: u32
margins (require NCPLANE_OPTION_MARGINALIZED)
Implementations§
source§impl NcPlaneOptions
impl NcPlaneOptions
§Constructors
sourcepub fn new(y: i32, x: i32, rows: u32, cols: u32) -> Self
pub fn new(y: i32, x: i32, rows: u32, cols: u32) -> Self
New NcPlaneOptions
using the horizontal x.
sourcepub fn builder() -> NcPlaneOptionsBuilder
pub fn builder() -> NcPlaneOptionsBuilder
Returns a default NcPlane
options builder.
sourcepub fn to_builder(&self) -> NcPlaneOptionsBuilder
pub fn to_builder(&self) -> NcPlaneOptionsBuilder
Returns a builder object from the current NcPlane
options.
sourcepub fn new_aligned(
y: i32,
align: impl Into<NcAlign>,
rows: u32,
cols: u32
) -> Self
pub fn new_aligned( y: i32, align: impl Into<NcAlign>, rows: u32, cols: u32 ) -> Self
New NcPlaneOptions
with horizontal alignment.
sourcepub 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
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.
sourcepub fn with_flags_aligned(
y: i32,
align: impl Into<NcAlign>,
rows: u32,
cols: u32,
resizecb: Option<NcResizeCb>,
flags: impl Into<NcPlaneFlag>
) -> Self
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
impl NcPlaneOptions
§Methods
sourcepub fn is_veraligned(&self) -> bool
pub fn is_veraligned(&self) -> bool
Returns true
if it has the VerAligned
flag set.
sourcepub fn is_horaligned(&self) -> bool
pub fn is_horaligned(&self) -> bool
Returns true
if it has the HorAligned
flag set.
sourcepub fn is_marginalized(&self) -> bool
pub fn is_marginalized(&self) -> bool
Returns true
if it has the Marginalized
flag set.
sourcepub fn is_autogrow(&self) -> bool
pub fn is_autogrow(&self) -> bool
Returns true
if it has the AutoGrow
flag set.
sourcepub fn is_vscroll(&self) -> bool
pub fn is_vscroll(&self) -> bool
Returns true
if it has the VScroll
flag set.