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
| # -*-coding:Latin-1 -*
## IMPORTATIONS #####################################################################
try:
import Tkinter as Tk
except:
import tkinter as Tk
import os
#from PIL import Image, ImageTk
#import Pmw
#import urllib
import platform
#import threading
## START LISTES #####################################################################
def start():
nomUtilisateur = os.environ.get("USERNAME")
# nomUtilisateur = str(nomUtilisateur)
# ...
graphic_app = simpleapp_tk()
# simulation des calculs
import time
time.sleep(10)
#
graphic_app.initialize()
## START WINDOW #####################################################################
class simpleapp_tk(Tk.Tk):
def __init__(self):
Tk.Tk.__init__(self)
self.wisplash = Tk.Toplevel()
Tk.Label(self.wisplash, text="Pease wait...", fg="red").pack(padx=5, pady=5)
self.wisplash.update()
self.withdraw()
self.title("Rainmeter updater")
def initialize(self):
self.vsb = Tk.Scrollbar(self, orient=Tk.VERTICAL)
self.vsb.grid(row=0, column=1, sticky=Tk.N+Tk.S)
self.hsb = Tk.Scrollbar(self, orient=Tk.HORIZONTAL)
self.hsb.grid(row=1, column=0, sticky=Tk.E+Tk.W)
self.canv = Tk.Canvas(self,
yscrollcommand=self.vsb.set,
xscrollcommand=self.hsb.set)
self.canv.grid(row=0, column=0, sticky=Tk.N+Tk.S+Tk.E+Tk.W)
self.vsb.config(command=self.canv.yview)
self.hsb.config(command=self.canv.xview)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self.frm = Tk.Frame(self.canv)
#self.iconbitmap("images/updater.ico")
## ETC...##
self.wisplash.destroy()
self.deiconify()
self.mainloop()
if __name__ == "__main__":
start() |
Partager