Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

GUI programming

$
0
0
Hi i'm new to python and i just statred learning gui programming with Tkinter and i've stumbled upon a little problem. I'm learnning from an ebook i downloaded and i am trying to replicate a program in that ebook but the program doesn't run i've checked it lots of times but still do not know what is wrong.
from Tkinter import *

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

    def create_widgets(self):
        self.bttn1 = Button(self, text="I do nothing")
        self.bttn1.grid()

        self.bttn2 = Button(self)
        self.bttn2.grid()
        self.bttn2.configure(text="Me too!")

        self.bttn3 = Button(self)
        self.bttn3.grid()
        self.bttn3["text"] = "Me also!"

#main        
root = Tk()
root.title("Lazy Buttons Again")
root.geometry("200x85")

app = Application(root)
root.mainloop()





Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>