Files
gambling-curses/main.c

66 lines
1.1 KiB
C
Raw Normal View History

2025-10-15 14:15:01 +02:00
2025-10-17 13:41:37 +02:00
/*
* Copyright (C) Artsiom D.
* Copyright (C) shit-co.de
*/
2025-10-16 14:43:32 +02:00
2025-10-17 13:41:37 +02:00
#include <stdlib.h>
#include <unistd.h>
2025-10-17 18:01:57 +02:00
#include <curses.h>
2025-10-15 14:15:01 +02:00
2025-10-17 13:41:37 +02:00
#include "box.h"
#include "ui.h"
2025-10-17 13:41:37 +02:00
int
main(void)
{
2025-10-17 18:01:57 +02:00
struct box *ui, *top, *bottom, *left, *right, *buy, *sell, *scam, *title, *desc;
2025-10-17 13:41:37 +02:00
ui_init();
2025-10-17 18:01:57 +02:00
title = new_button_box("Bitcoin");
desc = new_button_box("A crypto-scam :-)");
2025-10-17 18:01:57 +02:00
top = new_vertical_box();
top->length = 2;
top->children[0] = title;
top->children[1] = desc;
2025-10-15 14:15:01 +02:00
2025-10-17 18:01:57 +02:00
left = new_chart_box();
left->fills = 5;
buy = new_button_box("buy");
buy->color = UI_GREEN;
sell = new_button_box("sell");
sell->color = UI_RED;
scam = new_button_box("scam");
sell->color = UI_BLUE;
right = new_vertical_box();
right->length = 3;
right->children[0] = buy;
right->children[1] = sell;
right->children[2] = scam;
bottom = new_horizontal_box();
bottom->fills = 3;
bottom->length = 2;
bottom->children[0] = left;
bottom->children[1] = right;
2025-10-15 14:15:01 +02:00
2025-10-17 18:01:57 +02:00
ui = new_vertical_box();
ui->length = 2;
ui->children[0] = top;
ui->children[1] = bottom;
draw_box(ui, 0, 0, ui_width(), 40);
ui_refresh();
2025-10-16 14:43:32 +02:00
sleep(300);
2025-10-17 13:41:37 +02:00
ui_end();
2025-10-15 14:15:01 +02:00
}