Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 68654d1

Browse files
committed
Main using WIndow for Front
1 parent e733760 commit 68654d1

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/front.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ def __next(self):
3434

3535
def __load(self, name, image, data):
3636
self.title.config(text=name)
37-
self._last = self.image
3837
self.image = View(image, 'image')
3938
self.bio = View(Bio(self.window), 'widget')
39+
40+
self._last = self.image
4041
self.bio.data.load(data)
4142
self.update()
4243

@@ -98,11 +99,11 @@ def cache(self, imagecache: ImageCache):
9899

99100
class Bio(widget.PrimaryFrame):
100101

101-
# def init(self):
102-
# width = self.master.winfo_width()
103-
# height = self.master.winfo_height()
104-
# self.config(height=height, width=width)
105-
# #self.pack_propagate(0)
102+
def init(self):
103+
width = self.master.winfo_width()
104+
height = self.master.winfo_height()
105+
self.config(height=height, width=width)
106+
self.pack_propagate(0)
106107

107108
def __make_item(self, name, value):
108109
item = widget.SecondaryFrame(self)

src/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pygame import mixer
44

55
from .front import Front
6+
from .view import Window, View
67
from . import SETTINGS
78

89

@@ -23,6 +24,8 @@ def __init__(self, *args, **kwds):
2324
self.minsize(400, 500)
2425
self.maxsize(400, 500)
2526

26-
self.front = Front(self)
27+
self.window = Window(self)
28+
self.front = View(Front(self.window), 'widget')
2729

28-
self.front.pack(fill='both', expand=True)
30+
self.window.pack(fill='both', expand=True)
31+
self.window.set_view(self.front)

0 commit comments

Comments
 (0)