Python Forum
update a variable in parent window after closing its toplevel window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
update a variable in parent window after closing its toplevel window
#1
i want to update my variable in parent window when i close its toplevel window.
i cretaed a function "new_window"...this function creates a new window(Demo2 class) ...demo2 is a sample of Demo2 class...the "demo2.destroyed" is a variable for understanding whether the toplevel window was closed or not....
i recieved this error " 'int' object is not iterable"
why????
please help

my code is:
def new_window(self):
        
        demo2 = Demo2(self.master, self.var_sent)
        
        def check_demo2():
            if demo2.destroyed:
                
                global fasele
                global counter
                counter += fasele
        
                self.tyLabel.config(text=str(counter))
                
            else:
                self.master.after(100, check_demo2)

        check_demo2()]
Moderator:
added opening python code tag :-)
Reply


Messages In This Thread
update a variable in parent window after closing its toplevel window - by gray - Mar-12-2017, 12:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 537 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [Tkinter] CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" CopperGenie 1 401 Mar-03-2024, 04:32 AM
Last Post: deanhystad
  [Tkinter] (CLOSED) CTkScrollableDropdown error: bad window path name ".!ctkscrollabledropdown" CopperGenie 4 625 Mar-03-2024, 03:21 AM
Last Post: CopperGenie
  Transparent window background, but not text on it muzicman0 7 2,898 Feb-02-2024, 01:28 AM
Last Post: Joically
  pass a variable between tkinter and toplevel windows janeik 10 2,375 Jan-24-2024, 06:44 AM
Last Post: Liliana
  Tkinter multiple windows in the same window tomro91 1 866 Oct-30-2023, 02:59 PM
Last Post: Larz60+
  [Tkinter] Modal window DPaul 14 2,612 Oct-18-2023, 06:11 AM
Last Post: DPaul
  [PyQt] PyQt5 window closing when trying to display a graph bianca 4 1,738 Aug-12-2023, 03:25 PM
Last Post: bianca
Exclamation [Tkinter] Error when closing the main window with destroy TomasSanchexx 1 792 Aug-06-2023, 01:54 AM
Last Post: deanhystad
  Place QT Window in the middle AlphaInc 10 2,247 Aug-03-2023, 05:40 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

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