Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_rounded_entry.py
- from Tkinter import *
- from math import sin, cos, pi
- root = Tk()
- root.title("Tk Rounded Entry")
- ### root.withdraw() # vs root.deiconify()')
- xm,ym = 240,80
- canvas = Canvas(root, width=xm, height=ym)
- canvas.grid()
- x1,y1 = 40,40
- x2,r = 200,30
- vertex_count = 100
- t = pi/vertex_count
- a = 1.577
- VERTEX = [(x1,y1+r)]
- VERTEX += [( x1+r*cos(i*2*t+a), \
- y1+r*sin(i*2*t+a)) for i in range(vertex_count/2)]
- VERTEX += [(x2,y1-r)]
- VERTEX += [[( x2+r*cos(i*2*t+a), \
- y1+r*sin(i*2*t+a))] for i in range(vertex_count/2,vertex_count)]
- canvas.create_polygon(VERTEX, fill='white', width=5, outline='green')
- fff = ' '.join(['ariel', '18', 'italic'])
- sss = StringVar()
- ent = Entry(text=sss, font=fff, bg='white', relief=FLAT, width=15)
- ent.place(x=x1-16,y=y1-15)
- sss.set('Hello World !!!')
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement