fixed typo in example

This commit is contained in:
Chu'vok
2024-09-13 16:32:50 +02:00
parent a371c28e6c
commit 7257ce7543
3 changed files with 4 additions and 4 deletions

View File

@@ -1,13 +1,13 @@
#include "../tim.h" // one header, no lib #include "../tim.h" // one header, no lib
int main(void) { // int main(void) { //
while (tim_run(0)) { // event loop while (tim_run(0)) { // event loop
scope (A, A, 24, 8) { // centered scope scope (A, A, 24, 8) { // centered 24x8 scope
uint64_t c = 0x0a060f; // three colors uint64_t c = 0x0a060f; // three colors
frame(0, 0, ~0, ~0, c); // draw frame for scope frame(0, 0, ~0, ~0, c); // draw frame for scope
label("Greetings!", A, 2, A, A, c); // label in top center label("Greetings!", A, 2, A, A, c); // label in top center
if (button("OK", A, ~1, 8, A, c)) // button in bottom center if (button("OK", A, ~1, 8, A, c)) // button in bottom center
return 0; // exit on button click return 0; // exit on button click
if (is_key_press('q')) // if (is_key_press('q')) // ctrl-c is masked
return 0; // exit on 'q' press return 0; // exit on 'q' press
} // } //
} // } //

2
readme
View File

@@ -7,7 +7,7 @@ tim.h is an immediate mode toolkit for creating simple terminal guis
#include "tim.h" // one header, no lib #include "tim.h" // one header, no lib
int main(void) { // int main(void) { //
while (tim_run(0)) { // event loop while (tim_run(0)) { // event loop
scope (A, A, 24, 8) { // centered 28x8 scope scope (A, A, 24, 8) { // centered 24x8 scope
uint64_t c = 0x0a060f; // three colors uint64_t c = 0x0a060f; // three colors
frame(0, 0, ~0, ~0, c); // draw frame for scope frame(0, 0, ~0, ~0, c); // draw frame for scope
label("Greetings!", A, 2, A, A, c); // label in top center label("Greetings!", A, 2, A, A, c); // label in top center

2
tim.h
View File

@@ -7,7 +7,7 @@
// #include "tim.h" // one header, no lib // #include "tim.h" // one header, no lib
// int main(void) { // // int main(void) { //
// while (tim_run(0)) { // event loop // while (tim_run(0)) { // event loop
// scope (A, A, 24, 8) { // centered 28x8 scope // scope (A, A, 24, 8) { // centered 24x8 scope
// uint64_t c = 0x0a060f; // three colors // uint64_t c = 0x0a060f; // three colors
// frame(0, 0, ~0, ~0, c); // draw frame for scope // frame(0, 0, ~0, ~0, c); // draw frame for scope
// label("Greetings!", A, 2, A, A, c); // label in top center // label("Greetings!", A, 2, A, A, c); // label in top center