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 5698ce2

Browse files
committed
add
1 parent bb294c3 commit 5698ce2

File tree

8 files changed

+102
-0
lines changed

8 files changed

+102
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from tkinter import *
2+
3+
4+
class HelloButton(Button):
5+
def __init__(self, parent=None, **config):
6+
Button.__init__(self, parent, **config)
7+
8+
self.pack()
9+
self.config(command=self.callback)
10+
11+
def callback(self):
12+
print('good bye world/adeus mundo')
13+
self.quit()
14+
15+
if __name__ == '__main__':
16+
HelloButton(text='hello subclass world / ola mundo subclass').mainloop()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from tkinter import *
2+
3+
4+
class HelloButton(Button):
5+
def __init__(self, parent=None, **config):
6+
Button.__init__(self, parent, **config)
7+
8+
self.pack()
9+
self.config(command=self.callback)
10+
11+
def callback(self):
12+
print('good bye world/adeus mundo')
13+
self.quit()
14+
15+
if __name__ == '__main__':
16+
HelloButton(text='hello subclass world / ola mundo subclass').mainloop()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from gui5 import HelloButton
2+
3+
4+
class MyButton(HelloButton):
5+
def callback(self):
6+
print('ignoring press / ignorar aperto')
7+
8+
9+
if __name__ == '__main__':
10+
MyButton(
11+
None,
12+
text='hello sublclass world / ola mundo subclass'
13+
).mainloop()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
from tkinter import *
3+
4+
class ThemedButton(Button):
5+
def __init__(self, parent=None, **configs):
6+
Button.__init__(self, parent, **configs) # para configurar botao
7+
self.pack()
8+
9+
self.config(fg='green', bg='black', font=('caurier', 12), relief=RAISED, bd=5)
10+
11+
12+
b1 = ThemedButton(text='span', command='onSpan')
13+
b2 = ThemedButton(text='eggs / ovos')
14+
b2.pack(expand=YES, fill=BOTH)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from user_preferences import bcolor, bfont, bsize
2+
3+
4+
class ThemedButton(Button):
5+
def __init__(self, parent=None, **configs):
6+
Button.__init__(self, parent, **configs) # para configurar botao
7+
self.pack()
8+
9+
self.config(fg='green', bg='black', font=('caurier', 12), relief=RAISED, bd=5)
10+
11+
12+
b1 = ThemedButton(text='span', command='onSpan')
13+
b2 = ThemedButton(text='eggs / ovos')
14+
b2.pack(expand=YES, fill=BOTH)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from tkinter import *
2+
3+
4+
class HelloButton(Button):
5+
def __init__(self, parent=None, **config):
6+
Button.__init__(self, parent, **config)
7+
8+
self.pack()
9+
self.config(command=self.callback)
10+
11+
def callback(self):
12+
print('good bye world/adeus mundo')
13+
self.quit()
14+
15+
if __name__ == '__main__':
16+
HelloButton(text='hello subclass world / ola mundo subclass').mainloop()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from gui5 import HelloButton
2+
3+
4+
class MyButton(HelloButton):
5+
def callback(self):
6+
print('ignoring press / ignorar aperto')
7+
8+
9+
if __name__ == '__main__':
10+
MyButton(
11+
None,
12+
text='hello sublclass world / ola mundo subclass'
13+
).mainloop()

0 commit comments

Comments
(0)

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