mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Add {Const,}StringRef to simplify components.
This commit is contained in:
@@ -30,7 +30,7 @@ namespace ftxui {
|
||||
/// ```bash
|
||||
/// ☐ Make a sandwitch
|
||||
/// ```
|
||||
Component Checkbox(const std::wstring* label, bool* checked) {
|
||||
Component Checkbox(ConstStringRef label, bool* checked) {
|
||||
return Make<CheckboxBase>(label, checked);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ CheckboxBase* From(Component component) {
|
||||
return static_cast<CheckboxBase*>(component.get());
|
||||
}
|
||||
|
||||
CheckboxBase::CheckboxBase(const std::wstring* label, bool* state)
|
||||
CheckboxBase::CheckboxBase(ConstStringRef label, bool* state)
|
||||
: label_(label), state_(state) {}
|
||||
|
||||
Element CheckboxBase::Render() {
|
||||
|
Reference in New Issue
Block a user