Using A Class Structure to define GUI : UI Class : GUI Tk PYTHON examples


PYTHON examples » GUI Tk » UI Class »

 

Using A Class Structure to define GUI


Using A Class Structure to define GUI

from Tkinter import *

class MyApp:                         
  def __init__(self, myParent):
    self.myContainer1 = Frame(myParent)
    self.myContainer1.pack()
    
    self.button1 = Button(self.myContainer1
    self.button1["text"]"Hello"     
    self.button1["background""green"      
    self.button1.pack()                         
    
root = Tk()
myapp = MyApp(root)  
root.mainloop()      


           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo GUI Tk
» UI Class