Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f546f41

Browse files
committed
add
1 parent 5698ce2 commit f546f41

File tree

6 files changed

+83
-4
lines changed

6 files changed

+83
-4
lines changed

‎part3-guiProgramming/07-graphicalUserInterfaces/18-stardardizingBehaviorAndAppearance/2-commonApparence/2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ def __init__(self, parent=None, **configs):
77
self.pack()
88

99
self.config(fg='green', bg='black', font=('caurier', 12), relief=RAISED, bd=5)
10-
1110

12-
b1 = ThemedButton(text='span', command='onSpan')
13-
b2 = ThemedButton(text='eggs / ovos')
14-
b2.pack(expand=YES, fill=BOTH)
11+
class MyButton(ThemedButton):
12+
def __init__(self, parent, **configs):
13+
ThemedButton.__init__(self, parent, **configs)
14+
15+
16+
MyButton(command=onSpan)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from tkinter import *
2+
3+
4+
class Ola(Frame):
5+
def __init__(self, parent = None):
6+
Frame.__init__(self, parent)
7+
self.pack()
8+
9+
self.data = 5
10+
self.make_widgets()
11+
12+
def make_widgets(self):
13+
widget = Button(self, text='hello frame world/ola mundo frame',
14+
command=self.massage)
15+
widget.pack(side=LEFT)
16+
17+
18+
def massage(self):
19+
self.data +=1
20+
print(f'hello frame world {self.data}')
21+
22+
if __name__ == '__main__':
23+
Ola().mainloop()
1.04 KB
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from tkinter import *
2+
3+
4+
class Ola(Frame):
5+
def __init__(self, parent = None):
6+
Frame.__init__(self, parent)
7+
self.pack()
8+
9+
self.data = 5
10+
self.make_widgets()
11+
12+
def make_widgets(self):
13+
widget = Button(self, text='hello frame world/ola mundo frame',
14+
command=self.massage)
15+
widget.pack(side=LEFT)
16+
17+
18+
def massage(self):
19+
self.data +=1
20+
print(f'hello frame world {self.data}')
21+
22+
if __name__ == '__main__':
23+
Ola().mainloop()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from sys import exit
2+
3+
from tkinter import *
4+
from gui6 import Ola
5+
6+
parent = Frame(None)
7+
parent.pack()
8+
9+
Ola(parent).pack(side=LEFT)
10+
11+
Button(parent, text='attach', command=exit).pack(side=RIGHT)
12+
parent.mainloop()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from sys import exit
2+
3+
from tkinter import *
4+
from tkinter.font import names
5+
from gui6 import Ola
6+
7+
class HelloContainer(Frame):
8+
def __init__(self, parent=None):
9+
Frame.__init__(self, parent)
10+
self.pack()
11+
self.makeWidgets()
12+
13+
14+
def makeWidgets(self):
15+
Ola(self).pack(side=RIGHT)
16+
Button(self, text='attach', command=self.quit).pack(side=RIGHT)
17+
18+
if __name__ == '__main__':
19+
HelloContainer().mainloop()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /