Python Forum
Functions running before they should be - Python Tkinter logic error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions running before they should be - Python Tkinter logic error
#3
(Nov-23-2019, 01:49 AM)Larz60+ Wrote: I see where you define the new buttons, but not the first one. Also, you want to include code in NewLiveBet to make sure you don't try to recreate two already created Buttons. or delete the existing ones before recreating.

I found a way to fix it. I added "lambda" before calling the new functions in the button commands. So the button's code looks like this now:

button = Button(window, text='I am a button', command=lambda:buttonClickedFunction)
Reply


Messages In This Thread
RE: Functions running before they should be - Python Tkinter logic error - by jhf2 - Nov-23-2019, 03:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Help running a loop inside a tkinter frame Konstantin23 3 1,600 Aug-10-2023, 11:41 AM
Last Post: Konstantin23
  [Tkinter] Have tkinter button toggle on and off a continuously running function AnotherSam 5 5,052 Oct-01-2021, 05:00 PM
Last Post: Yoriz
  [Tkinter] Redirecting all print statements from all functions inside a class to Tkinter Anan 1 2,662 Apr-24-2021, 08:57 AM
Last Post: ndc85430
  Help with tkinter gui and functions Omer_ 0 1,533 Sep-22-2020, 11:43 AM
Last Post: Omer_
  [Tkinter] tkinter issue with variables carrying over between functions PengEng 1 1,758 Apr-06-2020, 06:13 PM
Last Post: deanhystad
  Functions with Tkinter Reldaing 2 2,575 Jan-03-2020, 06:57 PM
Last Post: Reldaing
  def functions in tkinter Fureneshi 5 7,614 Dec-26-2019, 11:34 PM
Last Post: woooee
  tkinter GUI, problem running seperate files fishglue 17 6,434 Oct-15-2019, 02:56 PM
Last Post: Denni
  Binding functions to Menus in tkinter?? Mocap 1 2,475 Jul-23-2019, 01:37 AM
Last Post: Larz60+
  Variable not sharing same value between two different functions Python 2.7 Tkinter albert 0 2,413 Aug-31-2018, 10:45 AM
Last Post: albert

Forum Jump:

User Panel Messages

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