File: test.html.disabled

package info (click to toggle)
ftxui 5.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,084 kB
  • sloc: cpp: 23,669; xml: 211; sh: 25; javascript: 20; python: 16; makefile: 15
file content (85 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!doctype html>
<html lang="en_US">
<head>
  <meta charset="utf-8">


  <style>
    html, body, textarea{
      margin:0;
      padding:0;
      width: 100%;
      height: 100%;
      overflow:hidden;
    }

    body {
      background-color:gray;
    };

    textarea {
      white-space: pre-wrap;
      background-color:white;
    }
  </style>

  <script type="text/c++">
    #include <iostream>

    #include <ftxui/screen/screen.hpp>
    #include <ftxui/dom/elements.hpp>

    int main() {
      using namespace ftxui;
      auto document =
        hbox(
          window(text(" main frame ") | hcenter,
            vbox(
              text("Line 1"),
              text("Line 2"),
              text("Line 3"),
              vbox(
                text("Line 4"),
                text("Line 5"),
                text("Line 6")
              ) | border,
              hbox(
                window(text("frame 2"),
                  vbox(
                    text("Line 4"),
                    gauge(0.5) | border,
                    text("Line 6")
                  )
                ),
                window(text("frame 3"),
                  vbox(
                    text("Line 7"),
                    text("Line 8"),
                    text("Line 9")
                  )
                )
              ),
              text("footer footer footer footer footer")
            )
          ),
          filler()
        );
      auto screen = Screen::Create(Dimension::Fit(document));
      Render(screen, document);
      std::cout << screen.ToString() << std::endl;
      return 0;
    }
  </script> 
</head>
<body>
  <textarea id="box"></textarea>
</body>
  <script>
    window.Module = {
      'print': function(text) {
        console.log(text);
        document.getElementById("box").value += text + '\n';
      }
    };
  </script>
</html>