Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:33:09+00:00 2026-05-31T03:33:09+00:00

I have a problem with a gui in python, the program executes the command

  • 0

I have a problem with a gui in python, the program executes the command option from the button creation automatic. so i get stuck in a loop.
”’
Created on 5-mrt.-2012

@author: Max
'''
from Tkinter import *


class main(Tk):
    def __init__(self,parent):
        self.mainWindow()
    def mainWindow(self):
        '''Make the main window '''
        self.quitAll()
        self.app = Tk()
        self.app.title('NMBS application')
        self.makeAppButtons()
        self.finish(self.app)
    def makeAppButtons(self):
        '''Make all the buttons for the main menu'''
        button_lijn = Button(self.app, text="Voeg lijnritten toe", command = self.lijnritten())
        button_lijn.pack()
    def finish(self,window):
        ''' Make the main window'''
        window.mainloop()
    def endButton(self,window):
        '''Make a quit button'''
        button_back = Button(window,text="Sluiten",command = self.mainWindow())
        button_back.pack()
    def quitAll(self):
        '''Close all the current windows'''
        self.lijn_window.quit()
        self.app.quit()
    def lijnritten(self):
        ''' Make the lijnritten window'''
        self.app.quit()
        self.lijn_window = Tk()
        self.lijn_window.title("lijnritten")
        self.endButton(self.lijn_window)
        self.finish(self.lijn_window)
main(None)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:33:10+00:00Added an answer on May 31, 2026 at 3:33 am

    When you link the commands, do it without the () so command=self.action, like this. Also this line seems to be giving you some trouble self.quitAll()… not sure what your trying to do with it but that’s my two cents.

    ''' 
    Created on 5-mrt.-2012
    @author: Max
    '''
    from Tkinter import *
    
    
    class main(Tk):
        def __init__(self,parent):
            self.mainWindow()
        def mainWindow(self):
            '''Make the main window '''
            #self.quitAll()
            self.app = Tk()
            self.app.title('NMBS application')
            self.makeAppButtons()
            self.finish(self.app)
        def makeAppButtons(self):
            '''Make all the buttons for the main menu'''
            button_lijn = Button(self.app, text="Voeg lijnritten toe", command = self.lijnritten)
            button_lijn.pack()
        def finish(self,window):
            ''' Make the main window'''
            window.mainloop()
        def endButton(self,window):
            '''Make a quit button'''
            button_back = Button(window,text="Sluiten",command = self.mainWindow)
            button_back.pack()
        def quitAll(self):
            '''Close all the current windows'''
            self.lijn_window.quit()
            self.app.quit()
        def lijnritten(self):
            ''' Make the lijnritten window'''
            self.app.quit()
            self.lijn_window = Tk()
            self.lijn_window.title("lijnritten")
            self.endButton(self.lijn_window)
            self.finish(self.lijn_window)
    main(None)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a python program with a wxpython GUI and some command line parameters.
I have a Python/wxPython program where the GUI is the main thread and I
I have a python GUI app that uses a long running function from a
I have a focus problem in C# GUI with tabs. I start a process
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have written a small GUI with qtdesigner and python which should display in
I am teaching myself some Python and I have come across a problem which
The problem I have is that I have this Python script to launch a
I've got a problem trying to get python to accept an import 'globally' In
I've written a simple GUI program in python using Tkinter. Let's call this program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.