Hi!
I am new to programming and I hop this question isn’t stupid.

I am making a small GUI program. It is supposed to have a button and a clock in 
it that displays the same time as it is according to the computer.
So as far as I am concerned both the clock and the are supposed to be widgets?


So how do I add this clock as a widget placed next to the button?


Here is the code I have written so far, that only displays a GUI window, and a 
button:


from tkinter import *
import time





class Window(Frame):
    def __init__(self,master):
        super(Window,self).__init__(master)
        self.grid()
        self.create_widgets()

    def create_widgets(self):
        self.test_button=Button(self, text="Hi")
        self.test_button.grid(row=0,column=0)


        
root=Tk()
root.title("Test")
root.geometry("200x200")
app=Window(root)
root.mainloop()
    


Thank you for your help!



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to