Python Forum
Buttons not appearing, first time button making
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Buttons not appearing, first time button making
#1
Hi, I have been watching python tutorials and finally got to GUI and have been trying to figure out buttons, I typed in the code as instructed however when the window opens there is still no quit button. Been looking at this for a while now and can't seem to figure out whats wrong. Am I perhaps missing a tkinter file? Here is the code:

from tkinter import *

class Window (Frame) :

    def __init__(self, master = None) :
        Frame.__init__(self, master)
        self.master = master
        self.init_window()

def init_window(self) :
    self.master.title("GUI")
    self.pack(fill=BOTH, expand=1)
    quitButton = Button(self, text="Quit")
    quitButton.place(x=0, y=0)

root = Tk()
root.geometry("400x300")
app = Window(root)
root.mainloop()
Reply


Messages In This Thread
Buttons not appearing, first time button making - by admiral_hawk - Dec-30-2018, 09:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter: An image and label are not appearing. emont 7 680 Mar-21-2024, 03:00 PM
Last Post: deanhystad
  My Background Image Is Not Appearing (Python Tkinter) HailyMary 2 4,381 Mar-14-2023, 06:13 PM
Last Post: deanhystad
  Figure Gets Larger Every time I click a show button joshuagreineder 2 1,337 Aug-11-2022, 06:25 AM
Last Post: chinky
  [Tkinter] Scrollable buttons with an add/delete button Clich3 5 3,476 Jun-16-2022, 07:19 PM
Last Post: rob101
  [Tkinter] Command button, then more command buttons Heyjoe 4 2,928 Aug-08-2020, 11:28 AM
Last Post: Yoriz
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,043 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  Tkinter widgets not appearing (3.x) RSAngryfiend 1 9,291 Jul-05-2017, 09:13 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020