[fix] Delete need_review, new scripts(vera,...)
[dotfiles_afify.git] / .vim / templates / python_gui / tkinter_template.py
blob142f6a2801b4913bd3121d2b9dffe4cb9f1defd6
1 #!/usr/bin/env python2.7
3 """
4 ===============================================================================
5 Name : file_name.py
6 Author : Hassan Afify
7 Website : http://hassan3afify.com
8 Version :
9 Copyright : Your copyright notice
10 Description :
11 ===============================================================================
12 """
14 # import tkFont
15 import Tkinter
18 class SimpleApp(object):
19 """This class create a gui."""
21 def __init__(self):
22 self.max_width = 500
23 self.max_height = 500
24 self.root_background = "grey"
25 self.title = "Cartoon Downloder"
27 self.root = Tkinter.Tk()
28 self.root.resizable(width=True, height=True)
29 self.root.wm_title(self.title)
30 self.root.configure(background=self.root_background)
32 # self.root.attributes('-fullscreen', True)
34 # self.root.geometry(str(self.max_width)+"x"+str(self.max_height))
36 self.create_lable(text="This is the welcome message",
37 color="green",
38 background="black",
39 font=20,
40 label_bg="black",
41 label_height=60,
42 x=0, y=0)
43 # entry_name = ttk.Entry(root, width=28, font =('Arial', 25))
44 # entry_name.grid(row=0, column=1, sticky='w')
45 # entry_name.bind("<Return>")
47 self.root.mainloop()
49 def create_lable(self, text, color, background, font, label_bg,
50 label_height, x, y):
51 """This method create a lable"""
53 label_frame = Tkinter.Frame(self.root,
54 width=self.max_width,
55 height=label_height,
56 bg=label_bg)
57 label_frame.pack_propagate(0)
58 Tkinter.Label(label_frame,
59 bg=background,
60 fg=color,
61 text=text,
62 font=("Calibri", font)).pack(fill=Tkinter.BOTH, expand=1)
63 label_frame.place(x=x, y=y)
65 # text = Tkinter.Label(master=self.root, text=text, bg=bg, fg=color)
66 # myFont = tkFont.Font(family="Times New Roman", size=20)
67 # text.configure(font=myFont)
68 # text.pack(fill=Tkinter.BOTH, expand=1)
69 # text.pack()
71 # go = Tkinter.Button(master=self.root , text='Start Game')
72 # go.pack()
73 # close = Tkinter.Button(master=self.root , text='Quit')
74 # close.pack()
77 SimpleApp()