Changed the project to python TUI
This commit is contained in:
51
Makefile
51
Makefile
@@ -1,51 +0,0 @@
|
|||||||
# GNU/Linux specific Make directives.
|
|
||||||
|
|
||||||
# Declare tools.
|
|
||||||
SHELL = /bin/sh
|
|
||||||
CC = clang++
|
|
||||||
LD = clang++
|
|
||||||
ECHO = @echo
|
|
||||||
|
|
||||||
CFLAGS = -std=c++17 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
|
|
||||||
LDFLAGS = -lncurses
|
|
||||||
|
|
||||||
EXECUTABLE = Sparks
|
|
||||||
|
|
||||||
SOURCES = main.cpp functions.cpp
|
|
||||||
OBJECTS = $(SOURCES:.cpp=.out)
|
|
||||||
CLEANFILES = *.out
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# To get a fully verbose make output do declare 'AT' at the command line like so: 'make AT='.
|
|
||||||
# By default AT is undefined and thus assigned the string '@' which suppresses output from commands.
|
|
||||||
AT ?= @
|
|
||||||
|
|
||||||
# Colors and efects
|
|
||||||
#######################################
|
|
||||||
NORMAL = \033[m
|
|
||||||
|
|
||||||
FG_DKGREEN = \033[32;7m
|
|
||||||
FG_REDFULL = \033[31;7m
|
|
||||||
FG_YELLOW = \033[33;7m
|
|
||||||
FG_BLUE = \033[34;7m
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
.SUFFIXES: .cpp .out
|
|
||||||
.PHONY: clean
|
|
||||||
|
|
||||||
# Compile
|
|
||||||
all: $(EXECUTABLE)
|
|
||||||
|
|
||||||
.cpp.out:
|
|
||||||
$(ECHO) "[$(FG_BLUE)COMPILING$(NORMAL)] $@"
|
|
||||||
$(AT) $(CC) $(CFLAGS) -o $*.out -c $<
|
|
||||||
|
|
||||||
$(EXECUTABLE): $(OBJECTS)
|
|
||||||
$(ECHO) "[$(FG_YELLOW)LINKING$(NORMAL)] $(EXECUTABLE)"
|
|
||||||
$(AT) $(LD) $(LDFLAGS) $(OBJECTS) -o $(EXECUTABLE)
|
|
||||||
$(ECHO) "[$(FG_DKGREEN)SUCCESS$(NORMAL)] Run ./$(EXECUTABLE) to start your application, Enjoy :)"
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(ECHO) "[$(FG_REDFULL)CLEANED$(NORMAL)] $(CLEANFILES)"
|
|
||||||
$(AT) rm -rf $(CLEANFILES)
|
|
@@ -1,10 +0,0 @@
|
|||||||
#ifndef __CHCOUNT_H__
|
|
||||||
#define __CHCOUNT_H__
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <ncurses.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
9
main.cpp
9
main.cpp
@@ -1,9 +0,0 @@
|
|||||||
#include "include/main.h"
|
|
||||||
|
|
||||||
int main () {
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << "Greetings, Aliens!!!!" << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
36
main.py
Normal file
36
main.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import pytermgui as ptg
|
||||||
|
|
||||||
|
# Define empty config as the base
|
||||||
|
#
|
||||||
|
# Note that we define markup tags as empty.
|
||||||
|
# markup tags **need** to be defined for program
|
||||||
|
# execution.
|
||||||
|
PTG_CONFIG = """\
|
||||||
|
config: {}
|
||||||
|
|
||||||
|
markup:
|
||||||
|
title: 210 bold
|
||||||
|
body: 245 italic
|
||||||
|
"""
|
||||||
|
|
||||||
|
with ptg.WindowManager() as manager:
|
||||||
|
# Initialize a loader, and load our config
|
||||||
|
loader = ptg.YamlLoader()
|
||||||
|
loader.load(PTG_CONFIG)
|
||||||
|
|
||||||
|
# Create a test window
|
||||||
|
manager.add(
|
||||||
|
ptg.Window()
|
||||||
|
+ "[title]This is our title"
|
||||||
|
+ ""
|
||||||
|
+ {"[body]First key": ['First button']}
|
||||||
|
+ {"[body]Second key": ['Second button']}
|
||||||
|
+ {"[body]Third key": ['Third button']}
|
||||||
|
+ ""
|
||||||
|
+ ["Exit", lambda *_: manager.exit()]
|
||||||
|
)
|
||||||
|
|
||||||
|
manager.run()
|
Reference in New Issue
Block a user