-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminWindow.py
40 lines (33 loc) · 1.3 KB
/
AdminWindow.py
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
import tkinter as tk
from tkinter import ttk
from userlist import UserList
from booklist import BookList
import AdminBookWindow
import AdminUserWindow
import langpack
class AdminWindow(tk.Toplevel):
def __init__(self, parent, selected_language):
super().__init__()
self.parent = parent
self.selected_language = selected_language
self.i18n = langpack.I18N(self.selected_language)
self.title("Admin")
self.geometry("250x100+710+290")
self.iconbitmap("python.ico")
self.create_widgets()
self.protocol("WM_DELETE_WINDOW", self.close_window)
def create_widgets(self):
btn_user_data = ttk.Button(self, text="User Data", width=15, command=self.show_user_data_window)
btn_book_data = ttk.Button(self, text="Book Data", width=15, command=self.show_book_data_window)
btn_user_data.pack(pady=(20, 0))
btn_book_data.pack(pady=(10, 0))
def show_user_data_window(self):
self.withdraw()
self.win2 = AdminUserWindow.AdminUserWindow(self, self.selected_language)
self.win2.grab_set()
def show_book_data_window(self):
self.withdraw()
self.win2 = AdminBookWindow.AdminBookWindow(self, self.selected_language)
self.win2.grab_set()
def close_window(self):
self.destroy()