Création du menu de l'éditeur de texte en Python tkinter. Dans ce tutoriel vidéo, nous allons voir comment ajouter une méthode de classe nommée add_menu permettant d'ajouter un menu pour l'éditeur bloc note créer par python tkinter. Nous créons la barre de menu via une instanciation sur la classe Menu de la bibliothèque tkinter. Nous créons ensuite l'étiquette Fichier du menu fichier avec la méthode add_cascade et ensuite étiquette Quitter qui sera associée à une action permettant de quitter la fenêtre. Nous montrons ensuite comment paramétrer le menu avec tearoff à False ou à True pour créer un menu détachable ou non détachable de l'éditeur. La version de Python utilisée est Python 3 - windows 7 - Python 3 - windows 8 Python 3 - windows 10. Pour un bon visionnage de la vidéo, utiliser le navigateur Google Chrome.
Creation of the text editor menu in Python tkinter. In this video tutorial, we will see how to add a class method named add_menu allowing to add a menu for the notepad editor created by python tkinter. We create the menu bar via instantiation on the Menu class of the tkinter library. We then create the File label of the File menu with the add_cascade method and then the Exit label which will be associated with an action allowing to quit the window. We then show how to set the menu with tearoff to False or True to create a tear-off or non-tear-off menu from the editor. The version of Python used is Python 3 - windows 7 - Python 3 - windows 8 Python 3 - windows 10. For a good viewing of the video, use the Google Chrome browser.