-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So many changes... So hard to keep track of
- Loading branch information
1 parent
7068302
commit fa421fd
Showing
18 changed files
with
193 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import cursesplus | ||
import curses | ||
import random | ||
e = "" | ||
def __test__(stdscr): | ||
global e | ||
#cursesplus.textview(stdscr,file="src/cursesplus/cp.py",message="LICENSE",isagreement=True,requireyes=True) | ||
e = cursesplus.filedialog.openfiledialog(stdscr,allowcancel=False) | ||
#e = cursesplus.checkboxlist(stdscr,{"Create Desktop Shortcut":False,"Create Start Menu Shortcut":True,"Register MIME type":True},"Choose optional features for installation",2,3) | ||
#cursesplus.textview(stdscr,file="/home/jordan/Coding/cursesplus/src/cursesplus/cp.py") | ||
#cursesplus.cursesinput(stdscr,"Hello",bannedcharacters="") | ||
|
||
if __name__ == "__main__": | ||
#Testing things | ||
curses.wrapper(__test__) | ||
print(e) | ||
win = cursesplus.show_ui() | ||
|
||
cursesplus.classic.optionmenu(win.screen,["hello","goodbyte"]) | ||
cursesplus.shutdown_ui() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import curses | ||
|
||
BLACK = curses.COLOR_BLACK | ||
WHITE = curses.COLOR_WHITE | ||
RED = curses.COLOR_RED | ||
YELLOW = curses.COLOR_YELLOW | ||
GREEN = curses.COLOR_GREEN | ||
CYAN = curses.COLOR_CYAN | ||
BLUE = curses.COLOR_BLUE | ||
MAGENTA = curses.COLOR_MAGENTA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import curses | ||
import os | ||
from .constants import * | ||
__SCREEN = None | ||
class AlreadyInitializedError(Exception): | ||
def __init__(self,message): | ||
self.message = message | ||
|
||
class Coord: | ||
def __init__(self,x,y): | ||
self.x = x | ||
self.y = y | ||
def as_tuple(self) -> tuple: | ||
return (self.x,self.y) | ||
def as_inverted_tuple(self) -> tuple: | ||
return (self.y,self.x) | ||
|
||
class BaseWindow: | ||
|
||
def __init__(self,screen): | ||
global __SCREEN | ||
self.screen = screen | ||
__SCREEN = screen | ||
self.size_x, self.size_y = os.get_terminal_size() | ||
self.size_x -= 1 | ||
|
||
class Window: | ||
def __init__(self,parent:BaseWindow,screen,size_x,size_y): | ||
self.screen = screen | ||
self.parent: BaseWindow = parent | ||
self.size_x = size_x | ||
self.size_y = size_y | ||
self.maximum_coords = Coord(size_x,size_y) | ||
|
||
def show_ui() -> BaseWindow: | ||
"""Start the user interface. Returns a BaseWindow you can use for editing""" | ||
global stdscr | ||
stdscr = curses.initscr() | ||
curses.noecho() | ||
curses.cbreak() | ||
curses.start_color() | ||
stdscr.keypad(True) | ||
return BaseWindow(stdscr) | ||
|
||
def shutdown_ui(): | ||
"""Shut down the UI and return the terminal to its normal state""" | ||
curses.nocbreak() | ||
stdscr.keypad(False) | ||
curses.echo() | ||
curses.endwin() |
Empty file.