Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
ZetCode Tkinter tutorial | ||
In this script, we draw text | ||
on the window. | ||
Author: Jan Bodnar | ||
Last modified: April 2019 | ||
Website: www.zetcode.com | ||
""" | ||
|
||
from tkinter import Tk, Canvas, Frame, BOTH, W | ||
|
||
class Example(Frame): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
self.initUI() | ||
|
||
|
||
def initUI(self): | ||
|
||
self.master.title("Lyrics") | ||
self.pack(fill=BOTH, expand=1) | ||
|
||
canvas = Canvas(self) | ||
canvas.create_text(20, 30, anchor=W, font="Purisa", | ||
text="Most relationships seem so transitory") | ||
canvas.create_text(20, 60, anchor=W, font="Purisa", | ||
text="They're good but not the permanent one") | ||
canvas.create_text(20, 130, anchor=W, font="Purisa", | ||
text="Who doesn't long for someone to hold") | ||
canvas.create_text(20, 160, anchor=W, font="Purisa", | ||
text="Who knows how to love without being told") | ||
canvas.create_text(20, 190, anchor=W, font="Purisa", | ||
text="Somebody tell me why I'm on my own") | ||
canvas.create_text(20, 220, anchor=W, font="Purisa", | ||
text="If there's a soulmate for everyone") | ||
canvas.pack(fill=BOTH, expand=1) | ||
|
||
|
||
def main(): | ||
|
||
root = Tk() | ||
ex = Example() | ||
root.geometry("420x250+300+300") | ||
root.mainloop() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |