Position X,Y d'un button après PACK
Bonjour,
est-il possible de récupérer la position X,Y d'un bouton après une opération pack ?
J'ai testé sans succès certaines choses dont :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
self.bt1 = Button(frame, text="Button 1",bg="blue", fg="white", font=("Helvetica",22), padx=(30) ,command=lambda: self.test(Tk))
self.bt1.pack(side=LEFT,padx=(30), pady=(20))
self.bt1.focus_set()
self.bt2 = Button(frame, text="Button 2", font=("Helvetica",22), padx=(30), command=lambda: self.test(Tk))
self.bt2.pack(side=LEFT,padx=(30), pady=(20))
self.bt3 = Button(frame, text="Button 3", font=("Helvetica",22), padx=(30), bg="red", fg="white", command=lambda: self.test(Tk))
self.bt3.pack(side=LEFT,padx=(30), pady=(20))
def test(self,Tk):
print(Tk.winfo_pointerxy(self)) |
quelqu'un sait il comment faire ?