Hola gente, ¿Cómo están?, lo que no puedo lograr es hacer que esta parte se mueva a derecha e izquierda según sea el botón que se le pasa el mouse.-
Poner la etiqueta en la función y "x" quede de esta manera:
guia = 20
label_ayuda = ttk.Label(ventana, text="", font = ('vardana', 12))
label_ayuda.place(x=guia, y=200, width=380, height=40)
El programa:
from tkinter import *
#import tkinter as tk
def ayudaUno(button):
if button == boton_buscar:
texto = " Buscar movimientos."
elif button == boton_editar:
texto = " Editar movimiento."
elif button == boton_cerrar:
texto = " Cerrar aplicación."
button.bind("<Enter>", func=lambda e: label_ayuda.config( text=texto))
button.bind("<Leave>", func=lambda e: label_ayuda.config( text=''))
def centrarVentana(ventana):
ancho_ventana = 500
alto_ventana = 260
x_ventana = ventana.winfo_screenwidth() // 2 - ancho_ventana // 2
y_ventana = ventana.winfo_screenheight() // 2 - alto_ventana // 2
posicion = str(ancho_ventana) + "x" + str(alto_ventana) + "+" + str(x_ventana) + "+" + str(y_ventana)
ventana.geometry(posicion)
ventana.resizable(0,0)
ventana = Tk()
ventana.title('Practica')
centrarVentana(ventana)
label_ayuda = ttk.Label(ventana, text="", font = ('vardana', 12))
label_ayuda.place(x=20, y=200, width=380, height=40)
boton_buscar = Button(ventana, text ="Buscar", relief=RAISED, background="light grey")
boton_buscar.place(x=100, y=160, width=80, height=40)
boton_editar = Button(ventana, text ="Editar", relief=RAISED, background="light grey")
boton_editar.place(x=200, y=160, width=80, height=40)
boton_cerrar = Button(ventana, text ="Cerrar", relief=RAISED, background="light grey", command = ventana.destroy )
boton_cerrar.place(x=300, y=160, width=80, height=40)
ayudaUno(boton_buscar)
ayudaUno(boton_editar)
ayudaUno(boton_cerrar)
ventana.mainloop()
Slds. Daniel ☕☕☕