A Text User Interface library for the Rust programming language
Cursive::on_event
to send simulated events.EventResult::and
to combine callbacks.ProgressBar
.enumset
version (fix compilation error)This releases is quite large and includes some breaking changes:
Cursive::new()
has been renamed Cursive::default()
. Cursive::new
is now used to select a backend, allowing third-party backends.ScrollView
. For TextView
, SelectView
and ListView
, it is opt-in, by wrapping it in a ScrollView
or calling .scrollable()
from the Scrollable
trait.Cursive::cb_sink()
now returns a crossbeam_channel::Sender
instead of chan::Sender
. The API is mostly similar.SelectView::selection
now returns a Option<Rc<T>>
instead of panicking on an empty list.AnyView
have been merged into the regular View
, so you should not need to use AnyView
directly, and can only use View
.Vec4
has been renamed to Margins
.In addition, many non-breaking changes are present as well:
Cursive::cb_sink()
are now processed instantly, without the need for set_fps
.SelectView::{set_selection, select_up, select_down, remove_item}
EditView::{set_content, insert, remove}
StackView::find_layer_from_id
SelectView::insert_item
TextArea::{enable, disable}
rect::Rect
Printer::with_theme
to apply a different theme to a subtree.Cursive::clear_global_callbacks
StackView::move_layer
SelectView
maplit
dependency for termion and blt backendsMajor update. Check CHANGELOG.md
for complete list.
Highlights:
TextView
can now display a StyledString
. A StyledString
can be built from multiple sources, including parsing markdown text.ColorStyle
.TextContent
to manage the content from a TextView
remotely.StackView
: added methods to re-order the layers, and reposition them on screen.Cursive::cb_sink
can now accept FnOnce
callbacksTextArea::set_content
TextArea::cursor(&self) -> usize
and TextArea::set_cursor(&mut self, usize)
Vec::splice
instead of VecExt
from the odds
crate. This may require rustc > 1.21SelectView
LinearLayout
ListView
and SelectView
.