-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_example.cpp
More file actions
47 lines (36 loc) · 1.05 KB
/
test_example.cpp
File metadata and controls
47 lines (36 loc) · 1.05 KB
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
#include <fern/fern.hpp>
#include <iostream>
using namespace Fern;
void setupUI() {
int width = Fern::getWidth();
int height = Fern::getHeight();
// Create a simple UI layout
auto title = Text(Point(width/2, 50), "Gleeb LSP Test", 3, Colors::White);
auto button = Button(ButtonPresets::Primary(0, 0, 120, 40, "Primary"));
auto textInput = TextInput(TextInputConfig(width/2 - 150, 220, 300, 40)
.placeholder("Type here..."));
// Test layout widgets
auto column = Column({
title,
SizedBox(0, 20),
button,
SizedBox(0, 20),
textInput
});
addWidget(Center(column));
// Test completion for Colors::
auto testColors = Colors::Red;
// Test completion for Fern::
auto testWidth = Fern::getWidth();
std::cout << "Gleeb LSP Test Application" << std::endl;
}
void draw() {
Draw::fill(Colors::Black);
}
int main() {
Fern::initialize();
setupUI();
Fern::setDrawCallback(draw);
Fern::startRenderLoop();
return 0;
}