mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Fix indices for screen code example and create call (#53)
PixelAt(10,10) was outside of the Screen and there is no c'tor for Dimensions but a static Create method.
This commit is contained in:
parent
e34dc1606e
commit
5d140845ee
@ -90,12 +90,13 @@ The screen can be printed as a string using ftxui::Screen::ToString().
|
|||||||
|
|
||||||
~~~cpp
|
~~~cpp
|
||||||
#include <ftxui/screen/screen.hpp>
|
#include <ftxui/screen/screen.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
using namespace ftxui;
|
using namespace ftxui;
|
||||||
auto screen = Screen(Dimension::Fixed(32), Dimension::Fixed(10));
|
auto screen = Screen::Create(Dimension::Fixed(32), Dimension::Fixed(10));
|
||||||
|
|
||||||
auto& pixel = screen.PixelAt(10,10);
|
auto& pixel = screen.PixelAt(9,9);
|
||||||
pixel.character = U'A';
|
pixel.character = U'A';
|
||||||
pixel.bold = true;
|
pixel.bold = true;
|
||||||
pixel.foreground_color = Color::Blue;
|
pixel.foreground_color = Color::Blue;
|
||||||
|
Loading…
Reference in New Issue
Block a user