elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Ayuda Tkinder
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda Tkinder  (Leído 2,071 veces)
Panic0

Desconectado Desconectado

Mensajes: 218



Ver Perfil
Ayuda Tkinder
« en: 12 Septiembre 2022, 06:05 am »

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):
Código:
 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 Desconectado

Mensajes: 81


Ver Perfil
Re: Ayuda Tkinder
« Respuesta #1 en: 12 Septiembre 2022, 06:32 am »

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

Código
  1. import tkinter as tk
  2.  
  3. root = tk.Tk()
  4. root.config(width=300, height=200)
  5. root.title("Botón en Tk")
  6. boton = tk.Button(text="¡Hola, mundo!",bd=0)
  7. boton.place(x=50, y=50)
  8. root.mainloop()


« Última modificación: 12 Septiembre 2022, 06:39 am por reymosquito » En línea

Panic0

Desconectado Desconectado

Mensajes: 218



Ver Perfil
Re: Ayuda Tkinder
« Respuesta #2 en: 12 Septiembre 2022, 06:43 am »

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):
Código:
 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 Desconectado

Mensajes: 218



Ver Perfil
Re: Ayuda Tkinder
« Respuesta #3 en: 12 Septiembre 2022, 06:44 am »

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

Código
  1. import tkinter as tk
  2.  
  3. root = tk.Tk()
  4. root.config(width=300, height=200)
  5. root.title("Botón en Tk")
  6. boton = tk.Button(text="¡Hola, mundo!",bd=0)
  7. boton.place(x=50, y=50)
  8. 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 Desconectado

Mensajes: 81


Ver Perfil
Re: Ayuda Tkinder
« Respuesta #4 en: 12 Septiembre 2022, 07:28 am »

Citar
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

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines