rendered paste body# -*- coding: utf-8 -*-
# Button oyunu
# Coded by rohanrhu
from Tkinter import *
import tkMessageBox as tm
import random
renkler = ("orange", "red", "blue", "yellow", "green")
x_ = random.randrange(0, 300)
y_ = random.randrange(0, 300)
def degistir(event):
bt.config(fg=random.choice(renkler))
bt.place(x=random.randrange(0, 450), y=random.randrange(0, 350))
def tikla(event):
tm.showinfo("Kazandınız!", "Bu zorlu görevi kazandığınız için size bir adet windows vista veriyoruz!")
tk = Tk()
tk.geometry("450x350")
tk.title("Button Oyunu!")
bt = Button(text="Tıkla!", command=tikla)
bt.place(x=x_, y=y_)
bt.bind("<Enter>", degistir)
tk.mainloop()