-
Notifications
You must be signed in to change notification settings - Fork 0
/
raid_frame.py
62 lines (51 loc) · 1.63 KB
/
raid_frame.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
__author__ = 'micha'
# ============================================
# IMPORTS
# ============================================
from Tkinter import *
from collections import OrderedDict
from gui import Gui
from travian import Travian
# ============================================
# CLASS DEFINITION
# ============================================
class Raiding(Gui):
def __init__(self, gui, app):
Gui.__init__(self)
# tk
self.root = gui
self.travian = app
# items
self.news = None
# frame
self.frame = Frame(self.root, bd=5, relief=GROOVE)
# widgets
self.labels = self.create_labels()
self.buttons = self.create_buttons()
# ============================================
# ITEMS
# ============================================
# WIDGETS
def create_labels(self):
dic = OrderedDict()
dic['main'] = self.create_main_label(self.frame, 'Raiding')
dic['bot'] = self.create_margin(self.frame)
return dic
def create_buttons(self):
dic = OrderedDict()
dic['all raids'] = Button(self.frame, text='All Raids', width=self.button_size, command=self.travian.send_all_raids)
return dic
# ============================================
# COMMANDS
# ============================================
# PACKING
def make_gui(self):
self.labels['main'].grid()
self.buttons['all raids'].grid(row=1, padx=5)
if __name__ == '__main__':
this_root = Tk()
travian = Travian(this_root)
t = Raiding(this_root, travian)
t.frame.pack()
t.make_gui()
t.root.mainloop()