-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.py
More file actions
55 lines (42 loc) · 1.78 KB
/
shell.py
File metadata and controls
55 lines (42 loc) · 1.78 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
50
51
52
53
54
55
import tkinter as tk
from tkinter import ttk
class ShellFrame(tk.Frame):
def __init__(self, root, callback):
super().__init__(root, width=600, height=400)
self.callback = callback
self.pack_propagate(0)
self.create_widgets()
def create_widgets(self):
# TODO: Implement the Libraries functionality
label = ttk.Label(self, text="This is the Shell Frame")
label.pack()
self.command_feed_frame = CommandFeedFrame(self)
self.command_feed_frame.pack(side="left", fill="both", expand=True)
self.interactive_shell_frame = InteractiveShellFrame(self)
self.interactive_shell_frame.pack(side="left", fill="both", expand=True)
back_button = ttk.Button(self, text="Back", command=self.back_button_click)
back_button.pack()
def back_button_click(self):
self.callback()
class CommandFeedFrame(tk.Frame):
def __init__(self, root):
super().__init__(root)
self.root = root
self.pack_propagate(0)
self.create_widgets()
def create_widgets(self):
# Create the feed text widget
self.feed_text = tk.Text(self, wrap="word")
self.feed_text.pack(side="top", fill="both", expand=True)
# TODO: Implement functionality to update the feed with running commands
class InteractiveShellFrame(tk.Frame):
def __init__(self, root):
super().__init__(root)
self.root = root
self.pack_propagate(0)
self.create_widgets()
def create_widgets(self):
# Create the shell text widget
self.shell_text = tk.Text(self, wrap="word")
self.shell_text.pack(side="top", fill="both", expand=True)
# TODO: Implement the interactive shell functionality and menu of features