Advertisement
Guest User

Untitled

a guest
Feb 17th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.56 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys
  3. import os
  4. import string
  5. import Tkinter
  6. import Pmw
  7. from Tkinter import *
  8. import tkMessageBox
  9. from Tkinter import Tk, RIGHT, BOTH, RAISED
  10. b1 = 'True'
  11. c1 = 'False'
  12. a1 = 1
  13.  
  14. class Example(Frame):
  15.  
  16.     def __init__(self, parent):
  17.         Frame.__init__(self, parent)  
  18.                  
  19.         self.parent = parent
  20.        
  21.         self.init()
  22.        
  23.         self.st = Pmw.ScrolledText(parent,labelpos = 'n',label_text='User Aggrement',usehullsize = 1,hull_width = 600,hull_height = 400,text_wrap='none',text_padx = 4,
  24.         text_pady = 4,
  25.     )
  26.     self.st.importfile('python.txt');
  27.     self.st.pack(padx = 5, pady = 5, fill = 'both', expand = 1)
  28.     self.st.configure(text_state = 'disabled')
  29.        
  30.     def init(self):
  31.      
  32.         self.parent.title(" User Aggrement")        
  33.         frame = Frame(self, relief=RAISED, borderwidth=.5)
  34.         frame.pack(fill=BOTH, expand=1)
  35.        
  36.         self.pack(fill=BOTH, expand=1)
  37.        
  38.                
  39.     def buttonPress(var):
  40.         #print 'The "%s" button was pressed' % var
  41.         if var == 'ok':
  42.             NextButton.configure(state=NORMAL)
  43.         elif var == 'Next':
  44.             os.system("top &") & exit()
  45.         elif var == 'close':           
  46.             a1 = tkMessageBox.askyesno("DisAgree", "Do you really wish to Disagree?" )     
  47.         if a1 == 1:
  48.             exit() 
  49.         else:
  50.             sys.exit
  51.      
  52.         NextButton = Tkinter.Button(self, text='Next',command = lambda b='Next':     buttonPress(b) )
  53.         NextButton.pack(side=RIGHT, padx=5, pady=5)
  54.         NextButton.configure(state=DISABLED )
  55.        
  56.                
  57.     def defaultKey(event):
  58.         def make_widgets(self):
  59.             buttonBox.invoke()
  60.             self1.make_widgets()
  61.        
  62.         root = Tkinter.tk()
  63.            
  64.                
  65.         QuitButton = Tkinter.Button(self, text="Quit",command = sys.exit  , font=('Arial', 10), fg="black")
  66.         QuitButton.pack(side=RIGHT, padx=5, pady=5)
  67.        
  68.        
  69.         DisAgreeButton = Tkinter.Button(self, text="DisAgree",command = lambda b='close':     buttonPress(b) , font=('Arial', 10), fg="black")       
  70.         DisAgreeButton.pack(side=RIGHT, padx=5, pady=5)
  71.        
  72.         AgreeButton = Tkinter.Button(self, text="Agree",command = lambda b='ok':     buttonPress(b) , font=('Arial', 10), fg="black")
  73.         AgreeButton.pack(side=RIGHT, padx=5, pady=5)
  74.         AgreeButton.focus_force()
  75.        
  76.        
  77.        # self.mainloop()
  78.        
  79.  ########################################################################################################################################      
  80.    
  81. def main():
  82.  
  83.     root = Tkinter.Tk()
  84.     root.geometry("600x400+30+30")
  85.     app = Example(root)
  86.     root.mainloop()    
  87.    
  88. if __name__ == '__main__':
  89.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement