Python Forum
Multi windows in tkinter buttons not responding correctly
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi windows in tkinter buttons not responding correctly
#2
I'm finding it hard to follow your code because there is no indentation within it as it's displayed here.
So it may be that when you are doing
ToggleButton1["text"] = ("Fireplace On")
It cannot see where you have defined ToggleButton1
also I think there is a syntax error anyway. I think it should be
ToggleButton1["text"] = "Fireplace On"
I'm a long way from being an expert but it seems there are many errors in the code. for example in a case where you use def
in this part of the code I have shown the indentation I would expect
class SampleApp(tk.Tk):
   def __init__(self, *args, **kwargs):
       tk.Tk.__init__(self, *args, **kwargs)

self.title_font = tkfont.Font(family='Helvetica', size=18, weight="bold", slant="italic")
self.title_font2 = tkfont.Font(family='Helvetica', size=10, weight="bold")
self.title_font3 = tkfont.Font(family='Helvetica', size=12, weight="bold")
self.title_font4 = tkfont.Font(family='Helvetica', size=10, weight="bold")
but I have no idea if the
self.title_font = tkfont.Font(family='Helvetica', size=18, weight="bold", slant="italic")
self.title_font2 = tkfont.Font(family='Helvetica', size=10, weight="bold")
self.title_font3 = tkfont.Font(family='Helvetica', size=12, weight="bold")
self.title_font4 = tkfont.Font(family='Helvetica', size=10, weight="bold")
part should be indented to be part of the class itself.
No doubt someone who is far more conversant with this will help.
Reply


Messages In This Thread
RE: Multi windows in tkinter buttons not responding correctly - by Barrowman - Jun-28-2017, 02:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter two windows instead of one jacksfrustration 7 971 Feb-08-2024, 06:18 PM
Last Post: deanhystad
  pass a variable between tkinter and toplevel windows janeik 10 2,542 Jan-24-2024, 06:44 AM
Last Post: Liliana
  Tkinter multiple windows in the same window tomro91 1 927 Oct-30-2023, 02:59 PM
Last Post: Larz60+
  tkinter toggle buttons not working Nu2Python 26 7,306 Jan-23-2022, 06:49 PM
Last Post: Nu2Python
  [PyGTK] How to center text on multi-line buttons? Lomax 3 4,319 Jan-23-2021, 03:23 PM
Last Post: Lomax
  Dual Tkinter windows and shells Astrikor 6 4,050 Sep-03-2020, 10:09 PM
Last Post: Astrikor
  [Tkinter] How to compare two variables correctly in tkinter scratchmyhead 2 3,942 May-10-2020, 08:04 PM
Last Post: scratchmyhead
  PyQt GUI not responding samuelbachorik 0 3,632 Apr-25-2020, 08:08 PM
Last Post: samuelbachorik
  TkInter Binding Buttons ifigazsi 5 4,651 Apr-06-2020, 08:30 AM
Last Post: ifigazsi
  Tkinter scaling windows conten to or with its size not working Detzi 5 4,562 Jan-12-2020, 12:42 PM
Last Post: Detzi

Forum Jump:

User Panel Messages

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