[Copy to clipboard] [ - ]
CODE:
#!/usr/bin/python
#filename : pythonMode.py
import wx
from Tkinter import *
import sys,os
sys.path.append(os.getcwd())
import XML_OPERA
class MainBuger:
#-----------------------------------------
# Function
#-----------------------------------------
def __init__ (self,master):
self.buton_denger = StringVar()
self.buton_serious = StringVar()
self.buton_proposal = StringVar()
self.color_denger = StringVar()
self.color_serious = StringVar()
self.color_proposal = StringVar()
self.test_userName = 'username'
def mainFrame (self):
denger_button = Button(root,textvariable = self.buton_denger,relief = GROOVE,width = 20,height = 2,bg ='red',command =self.changeText)
serious_button = Button(root,textvariable = self.buton_serious,relief = GROOVE,width = 20,height = 2,bg ='white',command =self.test_changeText)
proposal_button = Button(root,textvariable = self.buton_proposal,relief = GROOVE,width = 20,height = 2,bg ='yellow',command =self.test_1_changeText)
denger_button.grid(row=0,column=0)
serious_button.grid(row=0,column=1)
proposal_button.grid(row=0,column=2)
def changeText (self):
tl = Toplevel()
Label(tl,text = "quit").pack()
Button(tl,text='Quit',command=root.destroy).pack()
def test_changeText (self):
self.buton_denger.set('6')
self.buton_serious.set('9')
self.buton_proposal.set('56')
def test_1_changeText (self):
self.buton_denger.set('3')
self.buton_serious.set('2')
self.buton_proposal.set('5')
#-----------------------------------------
# Test
#-----------------------------------------
root = Tk()
root.overrideredirect(1)
root.geometry('550x30')
app = MainBuger(root)
app.mainFrame()
root.mainloop()