-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhack_manager_tk.py
More file actions
49 lines (38 loc) · 1.05 KB
/
hack_manager_tk.py
File metadata and controls
49 lines (38 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
48
49
#!/usr/bin/env python3
# GBA FE Hack Manager by MinN
#
# Simple tk interface
import sys
import os
import threading
import tkinter as tk
from tkinter import scrolledtext
import hack_manager
class RedirectText:
def __init__(self, text_ctrl):
self.output = text_ctrl
def write(self, string):
self.output.insert(tk.END, string)
def flush(self):
pass
def call_hack_manager():
threading.Thread(target=hack_manager.main).start()
def main():
hack_manager.cd_current()
if not os.path.isdir("patch"):
os.mkdir("patch")
if not os.path.isdir("rom"):
os.mkdir("rom")
window = tk.Tk()
window.title("FEGBA Hack Manager")
console = scrolledtext.ScrolledText(window)
console.pack()
sys.stdout = RedirectText(console)
button = tk.Button(window, text="Apply Patches", command=call_hack_manager)
button.pack()
window.lift()
window.attributes('-topmost', True)
window.after_idle(window.attributes, '-topmost', False)
window.mainloop()
if __name__ == '__main__':
main()