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 dfcb832

Browse files
committed
add
1 parent f546f41 commit dfcb832

File tree

6 files changed

+81
-0
lines changed

6 files changed

+81
-0
lines changed
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from tkinter import *
2+
from gui6 import Ola
3+
4+
class HelloExtender(Ola):
5+
def make_widgets(self):
6+
Ola.make_widgets(self)
7+
Button(self, text='extend/extendido', command=self.quit).pack(side=RIGHT)
8+
9+
def message(self):
10+
print('hello/oi ', self.data)
11+
12+
if __name__ == '__main__':
13+
HelloExtender().mainloop()
14+
15+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from tkinter import *
2+
3+
4+
class HelloPackage:
5+
def __init__(self, parent=None):
6+
self.top = Frame(parent) # embed a frame/ encobrindo uma frame
7+
self.top.pack()
8+
9+
self.data = 0
10+
11+
self.make_widgets()
12+
13+
def make_widgets(self):
14+
Button(self.top, text='bye/adeus/gis la revido', command=self.top.quit).pack(side=LEFT)
15+
Button(self.top, text='hye, eai, saluton', command=self.message).pack(side=RIGHT)
16+
17+
def message(self):
18+
self.data += 1
19+
print('hello number/oi numero', self.data)
20+
21+
if __name__ == '__main__':
22+
a = Tk()
23+
HelloPackage(a)
24+
25+
a.mainloop()
26+
27+
28+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from tkinter import *
2+
import tkinter
3+
from gui7 import HelloPackage
4+
5+
# chamando tk, obs: tem que chamar tk para funcionar/ nao livro nao eh chamado
6+
root = Tk()
7+
8+
frame = Frame(root)
9+
frame.pack()
10+
11+
Label(frame, text='hello/ ola').pack()
12+
13+
part = HelloPackage(frame)
14+
15+
root.mainloop() # <------------- mainloop aqui tambem

0 commit comments

Comments
(0)

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