Autor
|
Tema: Ayuda Tkinder (Leído 2,072 veces)
|
Panic0
Desconectado
Mensajes: 218
|
Hola, estoy diseñando el front-end de un programa en python, y quería saber como le puedo quitar el borde grueso de este botón Ese borde gris que le queda, no tengo ni idea como quitarlo, ya probe de todo dejo codigo (no de todo, solo de los botones): img_nuevo = PhotoImage(file=path_images+'/new.png') img_save = PhotoImage(file=path_images+'/save.png') img_save_new = PhotoImage(file=path_images+'/savenew.png') img_borrar = PhotoImage(file=path_images+'/recyfull.png') img_cancelar = PhotoImage(file=path_images+'/undo.png') img_primero = PhotoImage(file=path_images+'/frsrec_s.png') img_anterior = PhotoImage(file=path_images+'/prvrec_s.png') img_siguiente = PhotoImage(file=path_images+'/nxtrec_s.png') img_ultimo = PhotoImage(file=path_images+'/lstrec_s.png') img_buscar = PhotoImage(file=path_images+'/find.png') img_imprimir = PhotoImage(file=path_images+'/print.png') img_salir = PhotoImage(file=path_images+'/exit.png')
style = ttk.Style() style.configure('TButton', background='silver', height=29, width=45) global accion accion = StringVar()
self.frame_menu_acciones = Frame(self.master, bg = color_windows_top,relief='flat')#, text = accion self.frame_menu_acciones.pack(padx=23, pady=5, expand=False,side=LEFT, fill=BOTH)
self.frame_menu_cambios = Frame(self.master, bg =color_windows_top, relief='flat')#, text = accion self.frame_menu_cambios.pack(padx=10, pady=25, expand=False,side=BOTTOM, fill=X) #self.frame_menu_cambios['text'] = 'Menu Acciones'
################################################################################################## self.boton_nuevo = ttk.Button(self.frame_menu_acciones, image=img_nuevo )#, height=29) self.boton_nuevo.image = img_nuevo self.boton_nuevo.grid(row=0, column=0,padx=(10,1), pady=4) #self.boton_nuevo.bind('<Motion>', self.mostrar_accion) self.boton_grabar = ttk.Button(self.frame_menu_acciones, image=img_save)#, height=29) self.boton_grabar.grid(row=1, column=0,padx=(10,1),pady=4) self.boton_grabar.image = img_save #self.boton_grabar.bind('<Motion>', self.mostrar_accion)
self.boton_grabar_nuevo = ttk.Button(self.frame_menu_acciones, image=img_save_new)#, height=29) self.boton_grabar_nuevo.image = img_save_new self.boton_grabar_nuevo.grid(row=2, column=0,padx=(10,1),pady=4) #self.boton_grabar_nuevo.bind('<Motion>', self.mostrar_accion)
self.boton_borrar = ttk.Button(self.frame_menu_acciones, image=img_borrar)#, height=29) self.boton_borrar.image = img_borrar self.boton_borrar.grid(row=3, column=0,padx=(10,1),pady=4) #self.boton_borrar.bind('<Motion>', self.mostrar_accion)
self.boton_cancelar = ttk.Button(self.frame_menu_acciones, image=img_cancelar)#, height=29) self.boton_cancelar.image = img_cancelar self.boton_cancelar.grid(row=4, column=0,padx=(10,1), pady=4) # self.boton_cancelar.bind('<Motion>', self.mostrar_accion)
################################################################################################## self.boton_buscar = ttk.Button(self.frame_menu_cambios, image=img_buscar)#, height=29) self.boton_buscar.image = img_buscar self.boton_buscar.grid(row=0, column=0, padx=0, pady=4) #self.boton_buscar.bind('<Motion>', self.mostrar_accion)
self.boton_imprimir = ttk.Button(self.frame_menu_cambios, image=img_imprimir)#, height=29) self.boton_imprimir.image = img_imprimir self.boton_imprimir.grid(row=0, column=1, padx=10, pady=4) #self.boton_imprimir.bind('<Motion>', self.mostrar_accion)
self.boton_primero = ttk.Button(self.frame_menu_cambios, image=img_primero)#, height=29) self.boton_primero.image = img_primero self.boton_primero.grid(row=0, column=2, padx=(50,0), pady=4) #self.primero.bind('<Button-1>', self.primero_click) #self.boton_primero.bind('<Motion>', self.mostrar_accion)
self.boton_anterior = ttk.Button(self.frame_menu_cambios,image=img_anterior)#, height=29) self.boton_anterior.image = img_anterior self.boton_anterior.grid(row=0, column=3, padx=3, pady=4) #self.boton_anterior.bind('<Motion>', self.mostrar_accion)
self.boton_siguiente = ttk.Button(self.frame_menu_cambios, image=img_siguiente)#, height=29) self.boton_siguiente.image = img_siguiente self.boton_siguiente.grid(row=0, column=4, padx=3, pady=2) #self.boton_siguiente.bind('<Motion>', self.mostrar_accion)
self.boton_ultimo = ttk.Button(self.frame_menu_cambios, image=img_ultimo)#, height=29) self.boton_ultimo.image = img_ultimo self.boton_ultimo.grid(row=0, column=5, padx=(0,210), pady=4) #self.boton_ultimo.bind('<Motion>', self.mostrar_accion) ####################################################################################################
self.boton_salir = ttk.Button(self.frame_menu_cambios, image=img_salir, command=self.cerrar_ventana)#, height=29) self.boton_salir.image = img_salir self.boton_salir.grid(row=0, column=13, padx=3, pady=4) #self.boton_salir.bind('<Motion>', self.mostrar_accion)
|
|
« Última modificación: 12 Septiembre 2022, 06:56 am por Panic0 »
|
En línea
|
Los ataques de pánico suelen comenzar de forma súbita, sin advertencia.
|
|
|
reymosquito
Desconectado
Mensajes: 81
|
No se ve una imagen si es que la pusiste, por otro lado no es necesario tanto código, recrea una simple ventana con el código de un botón de como lo estás creando y será mucho más simple ayudarte Edito: un código sin borde import tkinter as tk root = tk.Tk() root.config(width=300, height=200) root.title("Botón en Tk") boton = tk.Button(text="¡Hola, mundo!",bd=0) boton.place(x=50, y=50) root.mainloop()
|
|
« Última modificación: 12 Septiembre 2022, 06:39 am por reymosquito »
|
En línea
|
|
|
|
Panic0
Desconectado
Mensajes: 218
|
Hola, estoy diseñando el front-end de un programa en python, y quería saber como le puedo quitar el borde grueso de este botón Ese borde gris que le queda, no tengo ni idea como quitarlo, ya probe de todo dejo codigo (no de todo, solo de los botones): img_nuevo = PhotoImage(file=path_images+'/new.png') img_save = PhotoImage(file=path_images+'/save.png') img_save_new = PhotoImage(file=path_images+'/savenew.png') img_borrar = PhotoImage(file=path_images+'/recyfull.png') img_cancelar = PhotoImage(file=path_images+'/undo.png') img_primero = PhotoImage(file=path_images+'/frsrec_s.png') img_anterior = PhotoImage(file=path_images+'/prvrec_s.png') img_siguiente = PhotoImage(file=path_images+'/nxtrec_s.png') img_ultimo = PhotoImage(file=path_images+'/lstrec_s.png') img_buscar = PhotoImage(file=path_images+'/find.png') img_imprimir = PhotoImage(file=path_images+'/print.png') img_salir = PhotoImage(file=path_images+'/exit.png')
style = ttk.Style() style.configure('TButton', background='silver', height=29, width=45) global accion accion = StringVar()
self.frame_menu_acciones = Frame(self.master, bg = color_windows_top,relief='flat')#, text = accion self.frame_menu_acciones.pack(padx=23, pady=5, expand=False,side=LEFT, fill=BOTH)
self.frame_menu_cambios = Frame(self.master, bg =color_windows_top, relief='flat')#, text = accion self.frame_menu_cambios.pack(padx=10, pady=25, expand=False,side=BOTTOM, fill=X) #self.frame_menu_cambios['text'] = 'Menu Acciones'
################################################################################################## self.boton_nuevo = ttk.Button(self.frame_menu_acciones, image=img_nuevo )#, height=29) self.boton_nuevo.image = img_nuevo self.boton_nuevo.grid(row=0, column=0,padx=(10,1), pady=4) #self.boton_nuevo.bind('<Motion>', self.mostrar_accion) self.boton_grabar = ttk.Button(self.frame_menu_acciones, image=img_save)#, height=29) self.boton_grabar.grid(row=1, column=0,padx=(10,1),pady=4) self.boton_grabar.image = img_save #self.boton_grabar.bind('<Motion>', self.mostrar_accion)
self.boton_grabar_nuevo = ttk.Button(self.frame_menu_acciones, image=img_save_new)#, height=29) self.boton_grabar_nuevo.image = img_save_new self.boton_grabar_nuevo.grid(row=2, column=0,padx=(10,1),pady=4) #self.boton_grabar_nuevo.bind('<Motion>', self.mostrar_accion)
self.boton_borrar = ttk.Button(self.frame_menu_acciones, image=img_borrar)#, height=29) self.boton_borrar.image = img_borrar self.boton_borrar.grid(row=3, column=0,padx=(10,1),pady=4) #self.boton_borrar.bind('<Motion>', self.mostrar_accion)
self.boton_cancelar = ttk.Button(self.frame_menu_acciones, image=img_cancelar)#, height=29) self.boton_cancelar.image = img_cancelar self.boton_cancelar.grid(row=4, column=0,padx=(10,1), pady=4) # self.boton_cancelar.bind('<Motion>', self.mostrar_accion)
################################################################################################## self.boton_buscar = ttk.Button(self.frame_menu_cambios, image=img_buscar)#, height=29) self.boton_buscar.image = img_buscar self.boton_buscar.grid(row=0, column=0, padx=0, pady=4) #self.boton_buscar.bind('<Motion>', self.mostrar_accion)
self.boton_imprimir = ttk.Button(self.frame_menu_cambios, image=img_imprimir)#, height=29) self.boton_imprimir.image = img_imprimir self.boton_imprimir.grid(row=0, column=1, padx=10, pady=4) #self.boton_imprimir.bind('<Motion>', self.mostrar_accion)
self.boton_primero = ttk.Button(self.frame_menu_cambios, image=img_primero)#, height=29) self.boton_primero.image = img_primero self.boton_primero.grid(row=0, column=2, padx=(50,0), pady=4) #self.primero.bind('<Button-1>', self.primero_click) #self.boton_primero.bind('<Motion>', self.mostrar_accion)
self.boton_anterior = ttk.Button(self.frame_menu_cambios,image=img_anterior)#, height=29) self.boton_anterior.image = img_anterior self.boton_anterior.grid(row=0, column=3, padx=3, pady=4) #self.boton_anterior.bind('<Motion>', self.mostrar_accion)
self.boton_siguiente = ttk.Button(self.frame_menu_cambios, image=img_siguiente)#, height=29) self.boton_siguiente.image = img_siguiente self.boton_siguiente.grid(row=0, column=4, padx=3, pady=2) #self.boton_siguiente.bind('<Motion>', self.mostrar_accion)
self.boton_ultimo = ttk.Button(self.frame_menu_cambios, image=img_ultimo)#, height=29) self.boton_ultimo.image = img_ultimo self.boton_ultimo.grid(row=0, column=5, padx=(0,210), pady=4) #self.boton_ultimo.bind('<Motion>', self.mostrar_accion) ####################################################################################################
self.boton_salir = ttk.Button(self.frame_menu_cambios, image=img_salir, command=self.cerrar_ventana)#, height=29) self.boton_salir.image = img_salir self.boton_salir.grid(row=0, column=13, padx=3, pady=4) #self.boton_salir.bind('<Motion>', self.mostrar_accion)
|
|
« Última modificación: 12 Septiembre 2022, 06:56 am por Panic0 »
|
En línea
|
Los ataques de pánico suelen comenzar de forma súbita, sin advertencia.
|
|
|
Panic0
Desconectado
Mensajes: 218
|
No se ve una imagen si es que la pusiste, por otro lado no es necesario tanto código, recrea una simple ventana con el código de un botón de como lo estás creando y será mucho más simple ayudarte Edito: un código sin borde import tkinter as tk root = tk.Tk() root.config(width=300, height=200) root.title("Botón en Tk") boton = tk.Button(text="¡Hola, mundo!",bd=0) boton.place(x=50, y=50) root.mainloop()
Tanto código por el motivo de que cada uno tiene una imagen. Ya arregle el tema de que no se veía la imagen
|
|
|
En línea
|
Los ataques de pánico suelen comenzar de forma súbita, sin advertencia.
|
|
|
reymosquito
Desconectado
Mensajes: 81
|
Tanto código por el motivo de que cada uno tiene una imagen ¿y? con hacer una ventana con el frame y un botón después podés revisar, en fin... no parece que el problema sea de los botones ya que están en un frame, ¿probaste con bd= 0 en la declaración del frame para ver que hace?, ¿otra cosa el frame ocupa toda la pantalla a lo alto? pueden ser varias cosas.
|
|
|
En línea
|
|
|
|
|
Mensajes similares |
|
Asunto |
Iniciado por |
Respuestas |
Vistas |
Último mensaje |
|
|
Ayuda por davor ayuda os ruego ayuda XD (SOLUCIONADO)
Hardware
|
XxRekcahlExX
|
6
|
10,587
|
24 Mayo 2010, 00:56 am
por Aprendiz-Oscuro
|
|
|
AYUDA -.- ahora no entro más en 4chan (tengo una duda, ayuda por favor)
Foro Libre
|
Draklit
|
6
|
8,768
|
15 Octubre 2010, 03:14 am
por Draklit
|
|
|
Alguna persona que me pueda ayudar con TKINDER (python)
Programación General
|
elhacker_carlos
|
0
|
1,585
|
1 Julio 2011, 08:58 am
por elhacker_carlos
|
|
|
[PYTHON][AYUDA][ERROR] Necesito ayuda para instalar PyGTK 2 en windows 7
Scripting
|
Noxware
|
2
|
7,626
|
20 Septiembre 2014, 00:05 am
por Noxware
|
|
|
[AYUDA] Ayuda para poner en modo monitor mi tarjeta de red! Kali LInux
GNU/Linux
|
Santi__
|
1
|
8,988
|
12 Noviembre 2016, 18:25 pm
por Will21
|
|