Und eine andere Möglichkeit sehe ich zurzeit auch noch nicht vor mir.
Es sollte ungefähr so aussehen:
Code: Alles auswählen
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Tkinter import Tk, BOTH
from ttk import Frame, Label, Button
class Beispiel(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
self.parent.title("Beispiel")
self.pack(fill=BOTH, expand=1)
myButton = Button(self, text="Click me", command=self.quit)
myButton.place(x=60, y=30)
myLabel = Label(self, text = "Beenden")
myLabel.place(x=75, y=70)
def main():
root = Tk()
root.geometry("250x150+300+300")
app = Beispiel(root)
root.mainloop()
if __name__ == '__main__':
main()