Tkinter/pruebas_iniciales.py
def createWidgets(self):
        """A method that creates the widgets"""
        self.QUIT = Button(self) # Defines and initialices QUIT as a Button
        self.QUIT["text"] = "QUIT" # Gives the hi_there button a text
        self.QUIT["fg"]   = "red" # Gives the hi_there button a color
        self.QUIT["command"] =  self.quit # Assigns a command to the hi_there button; in this case it closes the window and ends the program

        self.QUIT.pack({"side": "left"})

        self.hi_there = Button(self) # Defines and initialices hi_there as a Button
        self.hi_there["text"] = "Hello", # Gives the hi_there button a text
        self.hi_there["command"] = self.say_hi # Assigns a command to the hi_there button; in this case it calls the say_hi method

        self.hi_there.pack({"side": "left"})
A method that creates the widgets
A method that creates the widgets
A method that creates the widgets
def createWidgets(self):
        self.QUIT = Button(self) 
        self.QUIT["text"] = "QUIT" 
        self.QUIT["fg"]   = "red" 
        self.QUIT["command"] =  self.quit 
        self.QUIT.pack({"side": "left"})
        self.hi_there = Button(self) 
        self.hi_there["text"] = "Hello", 
        self.hi_there["command"] = self.say_hi 
        self.hi_there.pack({"side": "left"})
def createWidgets ( self ) : self . QUIT = Button ( self ) self . QUIT [ "text" ] = "QUIT" self . QUIT [ "fg" ] = "red" self . QUIT [ "command" ] = self . quit self . QUIT . pack ( { "side" : "left" } ) self . hi_there = Button ( self ) self . hi_there [ "text" ] = "Hello" , self . hi_there [ "command" ] = self . say_hi self . hi_there . pack ( { "side" : "left" } )
A method that creates the widgets
A method that creates the widgets
"""A method that creates the widgets""" # Defines and initialices QUIT as a Button # Gives the hi_there button a text # Gives the hi_there button a color # Assigns a command to the hi_there button; in this case it closes the window and ends the program # Defines and initialices hi_there as a Button # Gives the hi_there button a text # Assigns a command to the hi_there button; in this case it calls the say_hi method
self