⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Menu
tkinter.Menu ( ).post ( )
⇨ MENU ⇨ MODULES ⇨ tkinter ⇨ controles standards ⇨ Menu
tkinter.Menu ( ).post ( )
DESCRIPTION.
Affiche un menu déroulant aux coordonnées indiquées.
SYNTAXE.
MNU_Choix.post ( abscisse , ordonnee )
MNU_Choix ⇨ instance quelconque de tkinter.Menu ( ) [ OBLIGATOIRE ]
.post ( ) ⇨ appel de la méthode [ OBLIGATOIRE ]
abscisse ⇨ abscisse du point pivot [ OBLIGATOIRE ]
ordonnee ⇨ ordonnée du point pivot [ OBLIGATOIRE ]
REMARQUES.
abscisse doit être un int ( ) on float ( ) indiquant l'abscisse du point de référence, dans l'écran en général.
ordonnee doit être un int ( ) on float ( ) indiquant l'ordonnée du point de référence, dans l'écran en général.
EXEMPLE.
import tkinter
def FNC_Deplacer ( ) :
kabscisse = TKI_Principal.winfo_pointerx ( ) + 3
kordonnee = TKI_Principal.winfo_pointery ( ) + 3
MNU_Test.post ( kabscisse , kordonnee )
TKI_Principal.after ( 50 , FNC_Deplacer )
TKI_Principal = tkinter.Tk ( )
MNU_Menu = tkinter.Menu ( TKI_Principal )
MNU_Quitter = tkinter.Menu ( TKI_Principal )
MNU_Quitter.add_command (label = "Quitter le test" , command = TKI_Principal.destroy )
MNU_Menu.add_cascade ( menu = MNU_Quitter , label = "Quitter" )
TKI_Principal [ "menu" ] = MNU_Menu
MNU_Test = tkinter.Menu ( None )
MNU_Test.add_command ( label = "Choix A" )
MNU_Test.add_command ( label = "Choix B" )
MNU_Test.add_command ( label = "Choix C" )
FNC_Deplacer ( )
TKI_Principal.mainloop ( )
Votre aide est précieuse pour améliorer ce site, alors n'hésitez pas à faire part de