Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problème command
In this forum, users live in many different places around the world, but everybody agrees on the use of english as a common language, so please try to write your future posts in english. I know it can be difficult but there are online translation tools that can help you with this.

Concerning the code, usually one uses a single Tk instance at a time in tkinter, so if you want to create several toplevel windows, use instances of the Toplevel class instead. Also mainloop() is normally called on a single window. I changed a few things in the code to make it work.

from tkinter import *
def louer_materiel():
    def louer():
    fenetre1 = Toplevel()
    entree = Entry(fenetre1,textvariable=saisir, width=30).grid(row=2, column=2,columnspan=2,pady=8)
    bouton_valider  = Button(fenetre1, text="ok", command=louer,width=10,heigh=1).grid(row=3,column=2,padx=20, pady=8)

def acceuil ():
    fenetre = Tk()
    bouton1 = Button(fenetre, text="Louer un matériel",width=36,heigh=1,command=louer_materiel).grid(row=2,column=1,padx=20, pady=8)

Messages In This Thread
Problème command - by paulo - Feb-08-2020, 04:01 PM
RE: Problème command - by Gribouillis - Feb-08-2020, 06:20 PM
RE: Problème command - by paulo - Feb-09-2020, 08:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  petit problème python salahoum 1 841 Jan-21-2019, 11:37 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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