Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/mainloop.cpython-34.pyc
Binary file not shown.
Binary file added __pycache__/screens.cpython-34.pyc
Binary file not shown.
Binary file modified __pycache__/screens.cpython-35.pyc
Binary file not shown.
Binary file added __pycache__/window.cpython-34.pyc
Binary file not shown.
Binary file modified __pycache__/window.cpython-35.pyc
Binary file not shown.
11 changes: 0 additions & 11 deletions appinst/exe.md

This file was deleted.

13 changes: 0 additions & 13 deletions appinst/setup.py

This file was deleted.

Binary file added dist/LearnPythonWithPython.exe
Binary file not shown.
1 change: 1 addition & 0 deletions mainloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
master.geometry("500x250")
app = Screens(master=master)
master.mainloop()

226 changes: 147 additions & 79 deletions screens.py

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions setup_exe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from distutils.core import setup
import py2exe
import window, screens

setup(
console = [{
"script": "mainloop.py",
"icon_resources": [(1, "pycon-icon.ico")],
"dest_base": "LearnPythonWithPython"
}]
)
14 changes: 7 additions & 7 deletions window.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Window(Frame):
def __init__(self, master=None):
super(Window, self).__init__()
self.s_init()
self.s_init(1)

def close_app(self):
self.master.destroy()
Expand All @@ -21,8 +21,8 @@ def choBtn(self, txt, func, x, y):
def btnQuit(self):
return self.choBtn("Quit", self.close_app, 0, 0)

def btnBack(self):
return self.choBtn("Back", self.s_init, 0, 0)
def btnBack(self, unit):
return self.choBtn("Back", lambda: self.s_init(unit), 0, 0)

def btnNext(self, nextScreen):
return Button(self, text="Next", command=nextScreen).place(relx=1.0, rely=1.0, anchor=SE)
Expand All @@ -39,12 +39,12 @@ def cenLbl(self, txt):
return Label(self, text=txt).pack()

def multiLbl(self, txt):
return Label(self, text=txt, anchor=W, wraplength=425).pack()
return Label(self, text=txt, wraplength=750).pack(anchor=W)

def new(self, home=False):
def new(self, unit):
for widget in self.winfo_children():
widget.destroy()
if home == True:
if unit == 0:
self.btnQuit()
else:
self.btnBack()
self.btnBack(unit)