1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
## START WINDOW #####################################################################
class simpleapp_tk(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.initialize()
self.minsize(650,85)
self.iconbitmap("images/updater.ico")
def initialize(self):
self.grid()
l=9
i=0
## AFFICHE NBR ACTIVE SKINS ##
self.labelVariable = Tkinter.StringVar()
label = Tkinter.Label(self,textvariable=self.labelVariable,
anchor="w",fg="black")
label.grid(column=0,row=0,sticky='EW',columnspan=2)
if nbr_actived_skin==1 or nbr_actived_skin==0:
self.labelVariable.set(str(nbr_actived_skin)+" Actived skin\n")
else:
self.labelVariable.set(str(nbr_actived_skin)+" Actived skins\n")
## AFFICHE BOUTTON REFRESH ##
monimagezz = Image.open("images/refresh.png")
photozz = ImageTk.PhotoImage(monimagezz)
label = Tkinter.Label(image=photozz)
label.image = photozz
label.pack()
label.place(x=620, y=5, width=30, height=30)
label.bind("<Button-1>", refresh_window)
l=9
i=0
while i<len(skins):
if i in liste_nom_skin and i not in liste_popup:
## AFFICHE BARRE TOP SKINS ##
monimage = Image.open("images/barre_top_skin.png")
photo = ImageTk.PhotoImage(monimage)
label = Tkinter.Label(image=photo)
label.image = photo
label.pack()
label.grid(column=1,row=l,sticky='EW',columnspan=2)
## AFFICHE NOM ET VERSION INSTALLED SKINS ##
self.labelVariable = Tkinter.StringVar()
label = Tkinter.Label(self,textvariable=self.labelVariable,
anchor="w",fg="black")
label.grid(column=1,row=l+1,sticky='EW')
self.labelVariable.set(liste_nom_skin[i] + " (" + liste_version_skin[i] +")")
if i in liste_popup:
popup(liste_popup[i])
l+=3
i+=1
## CONFIG SELF ##
self.grid_columnconfigure(0,weight=600)
self.grid_columnconfigure(1,weight=1)
self.resizable(False,True)
self.update()
if __name__ == "__main__":
app = simpleapp_tk(None)
app.title("Rainmeter skins updater")
app.mainloop() |
Partager