work on status bar
This commit is contained in:
parent
3e2cc80a80
commit
15e05ac580
2 changed files with 31 additions and 1 deletions
|
@ -10,6 +10,7 @@ from coretk.images import ImageEnum, Images
|
||||||
from coretk.menuaction import MenuAction
|
from coretk.menuaction import MenuAction
|
||||||
from coretk.menubar import Menubar
|
from coretk.menubar import Menubar
|
||||||
from coretk.nodeutils import NodeUtils
|
from coretk.nodeutils import NodeUtils
|
||||||
|
from coretk.status import StatusBar
|
||||||
from coretk.toolbar import Toolbar
|
from coretk.toolbar import Toolbar
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ class Application(tk.Frame):
|
||||||
self.canvas.configure(yscrollcommand=scroll_y.set)
|
self.canvas.configure(yscrollcommand=scroll_y.set)
|
||||||
|
|
||||||
def draw_status(self):
|
def draw_status(self):
|
||||||
self.statusbar = ttk.Frame(self)
|
self.statusbar = StatusBar(master=self, app=self)
|
||||||
self.statusbar.pack(side=tk.BOTTOM, fill=tk.X)
|
self.statusbar.pack(side=tk.BOTTOM, fill=tk.X)
|
||||||
|
|
||||||
def on_closing(self):
|
def on_closing(self):
|
||||||
|
|
29
coretk/coretk/status.py
Normal file
29
coretk/coretk/status.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"status bar"
|
||||||
|
from tkinter import ttk
|
||||||
|
|
||||||
|
|
||||||
|
class StatusBar(ttk.Frame):
|
||||||
|
def __init__(self, master, app, **kwargs):
|
||||||
|
super().__init__(master, **kwargs)
|
||||||
|
self.app = app
|
||||||
|
|
||||||
|
self.status = None
|
||||||
|
self.zoom = None
|
||||||
|
self.cpu_usage = None
|
||||||
|
self.memory = None
|
||||||
|
self.emulation_light = None
|
||||||
|
self.draw()
|
||||||
|
|
||||||
|
def draw(self):
|
||||||
|
self.columnconfigure(0, weight=8)
|
||||||
|
self.columnconfigure(1, weight=1)
|
||||||
|
self.columnconfigure(2, weight=1)
|
||||||
|
self.columnconfigure(3, weight=1)
|
||||||
|
self.status = ttk.Label(self, text="status")
|
||||||
|
self.status.grid(row=0, column=0)
|
||||||
|
self.zoom = ttk.Label(self, text="zoom")
|
||||||
|
self.zoom.grid(row=0, column=1)
|
||||||
|
self.cpu_usage = ttk.Label(self, text="cpu usage")
|
||||||
|
self.cpu_usage.grid(row=0, column=2)
|
||||||
|
self.emulation_light = ttk.Label(self, text="emulation light")
|
||||||
|
self.emulation_light.grid(row=0, column=3)
|
Loading…
Reference in a new issue