Python Forum
Issue on tkinter with buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue on tkinter with buttons
#1
Hi, Here's my problem I want that when You press "button3" after having pressed"button", it also destroys label6 from" do_it" function.


    def do_it():
        F= calcul_salarie(i.get(), k.get(), revenu_moyen.get(), trimestre_cotisés.get(), enfants.get())
        G=F/12
        RA=int(F/12)
        A= str(i.get())+", Ta pension de retraite sera de: "+str(F)+"€ par an, soit de :"+str(RA)+"€ par mois"

        button.destroy()
        label6= Label(Appli,text=A,font=("arial",15,"bold"), fg="black")
        label6.place(x=20, y=100)
        
        





    def return_page():
        button3.destroy()
        page_principale()
        label1.destroy()
        entry_box1.destroy()
        label2.destroy()
        entry_box2.destroy()
        label3.destroy()
        entry_box3.destroy()
        label4.destroy()
        entry_box4.destroy()
        label5.destroy()
        entry_box5.destroy()
        label6.destroy()

    button= Button(Appli, text="Calulate", width="18", height="9",command=do_it,bg="white")
    button.place(x=500, y=470)

    button3= Button(Appli, text="Initial page", width="18", height="9",command=return_page,bg="white")
    button3.place(x=50,y=200)

    
Reply


Messages In This Thread
Issue on tkinter with buttons - by Reldaing - Jan-06-2020, 07:42 PM
RE: Issue on tkinter with buttons - by berckut72 - Jan-07-2020, 08:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb [Tkinter] Tkinter Class Import Module Issue AaronCatolico1 6 3,146 Sep-06-2022, 03:37 PM
Last Post: AaronCatolico1
  tkinter toggle buttons not working Nu2Python 26 7,043 Jan-23-2022, 06:49 PM
Last Post: Nu2Python
  Super basic tkinter arduino issue Kurta 3 2,432 Jan-07-2021, 05:22 PM
Last Post: deanhystad
Photo tkinter issue mate 4 2,560 Dec-06-2020, 09:03 PM
Last Post: mate
  Issue in Tkinter with winfo_class() and LabelFrame ReDefendeur 1 2,757 Oct-05-2020, 05:52 AM
Last Post: Jeff900
  [Tkinter] tkinter: after issue edwin6938 1 3,418 Aug-25-2020, 04:37 PM
Last Post: Larz60+
  Tkinter: increasing numbers and Radiobutton issue PeroPuri 1 2,177 Apr-13-2020, 05:48 PM
Last Post: deanhystad
  [Tkinter] tkinter issue with variables carrying over between functions PengEng 1 1,757 Apr-06-2020, 06:13 PM
Last Post: deanhystad
  TkInter Binding Buttons ifigazsi 5 4,437 Apr-06-2020, 08:30 AM
Last Post: ifigazsi
  Need tkinter help with clicking buttons pythonprogrammer 2 2,480 Jan-03-2020, 04:43 AM
Last Post: joe_momma

Forum Jump:

User Panel Messages

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