mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-11-01 02:58:12 +08:00 
			
		
		
		
	Feature: Windows. (#690)
Into ftxui/component/, add: ``` Container::Stacked(...) Window(...); ``` Together, they can be used to display draggable/resizable windows. Bug:https://github.com/ArthurSonzogni/FTXUI/issues/682 * Fix typo.
This commit is contained in:
		| @@ -35,4 +35,3 @@ example(style_underlined_double) | ||||
| example(table) | ||||
| example(vbox_hbox) | ||||
| example(vflow) | ||||
| example(window) | ||||
|   | ||||
| @@ -1,34 +0,0 @@ | ||||
| #include <stdlib.h>                // for EXIT_SUCCESS | ||||
| #include <ftxui/dom/elements.hpp>  // for operator|=, Element, bgcolor, color, graph, border | ||||
| #include <ftxui/screen/screen.hpp>  // for Fixed, Screen | ||||
| #include <vector>                   // for vector | ||||
|  | ||||
| #include "ftxui/dom/node.hpp"      // for Render | ||||
| #include "ftxui/screen/color.hpp"  // for Color, Color::DarkBlue, Color::Red, ftxui | ||||
|  | ||||
| int main() { | ||||
|   using namespace ftxui; | ||||
|   Element document = graph([](int x, int y) { | ||||
|     std::vector<int> result(x, 0); | ||||
|     for (int i{0}; i < x; ++i) { | ||||
|       result[i] = ((3 * i) / 2) % y; | ||||
|     } | ||||
|     return result; | ||||
|   }); | ||||
|  | ||||
|   document |= color(Color::Red); | ||||
|   document |= bgcolor(Color::DarkBlue); | ||||
|   document |= border; | ||||
|  | ||||
|   const int width = 80; | ||||
|   const int height = 10; | ||||
|   auto screen = | ||||
|       Screen::Create(Dimension::Fixed(width), Dimension::Fixed(height)); | ||||
|   Render(screen, document); | ||||
|   screen.Print(); | ||||
|   return EXIT_SUCCESS; | ||||
| } | ||||
|  | ||||
| // Copyright 2020 Arthur Sonzogni. All rights reserved. | ||||
| // Use of this source code is governed by the MIT license that can be found in | ||||
| // the LICENSE file. | ||||
		Reference in New Issue
	
	Block a user
	 Arthur Sonzogni
					Arthur Sonzogni