| 
	
		|  Autor | Tema: [Python + tkinter] Ayuda con marco de una ventana y sus botones  (Leído 12,750 veces) |  
	| 
			| 
					
						| darkweb64 
								
								 Desconectado 
								Mensajes: 17
								
								   | 
 
Buen día miembros del foro, necesito ayuda para quitar por completo los botones de minimizar, maximizar y cerrar de una ventana estándar en tkinter. He logrado quitar el botón de maximizar y minimizar como muestro en el código de abajo. Pero quiero mantener el borde para que se vea el título de la ventana sin ningún botón. from tkinter import *
 root = Tk()
 root.title("Ventana con nombre del programa")
 #root.overrideredirect(1) # No me sirve quita todo
 root.attributes("-toolwindow",-1) # Solo permite el botón cerra en una ventana
 root.mainloop()
 
 
 |  
						| 
								|  |  
								| « Última modificación:  7 Octubre 2015, 19:22 pm por darkweb64 » |  En línea | 
 
 |  |  |  | 
			| 
					
						| 0roch1 
								
								 Desconectado 
								Mensajes: 123
								
								   | 
 
¿En qué sistema operativo estás trabajando? 
 
 |  
						| 
								|  |  
								| « Última modificación:  7 Octubre 2015, 19:15 pm por 0roch1 » |  En línea | 
 
 |  |  |  | 
			| 
					
						| darkweb64 
								
								 Desconectado 
								Mensajes: 17
								
								   | 
 
Es para windows y uso python3.4 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| 0roch1 
								
								 Desconectado 
								Mensajes: 123
								
								   | 
 
Nunca lo he intentado pero esto es algo que se me ocurre por el momento. __author__ = '0roch1'# -*- coding: utf-8 -*-try:    from Tkinter import * # Python2except ImportError:     from tkinter import * # Python3 def __Cancel(event=None): pass root = Tk()root.title("Título")root.resizable(0,0)root.attributes("-toolwindow",-1)root.protocol('WM_DELETE_WINDOW', __Cancel ) root.mainloop() 
 Otra cosa que se pude hacer es utilizar  root.overrideredirect(1) 
 y después agregar un borde a la ventana. |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| darkweb64 
								
								 Desconectado 
								Mensajes: 17
								
								   | 
 
Gracias, lo probé y aunque no quita el botón cerrar de la barra lo anula, aunque me parece extraño que exista una forma para quitar el de maximizar y minimizar y no ese.  |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| 0roch1 
								
								 Desconectado 
								Mensajes: 123
								
								   | 
 
No, no lo quita, decía que era posiblemente una forma, pensé que lo que te interesaba era que no cerraran la ventana pero más bien quieres quitarlo por diseño, no?.
 Lo único que quieres quitar son los botones, dejar la barra de título y mantener el borde de la ventana?.
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| darkweb64 
								
								 Desconectado 
								Mensajes: 17
								
								   | 
 
Sí, mantener la barra pero sin botones. |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| 0roch1 
								
								 Desconectado 
								Mensajes: 123
								
								   | 
 
¿Qué intentas hacer? Esto te servirá?. """Python Tkinter Splash Screen This script holds the class SplashScreen, which is simply a window withoutthe top bar/borders of a normal window. The window width/height can be a factor based on the total screen dimensionsor it can be actual dimensions in pixels. (Just edit the useFactor property) Very simple to set up, just create an instance of SplashScreen, and use it asthe parent to other widgets inside it. www.sunjay-varma.com""" from Tkinter import * class SplashScreen(Frame):    def __init__(self, master=None, width=0.8, height=0.6, useFactor=True):        Frame.__init__(self, master)        self.pack(side=TOP, fill=BOTH, expand=YES)         # get screen width and height        ws = self.master.winfo_screenwidth()        hs = self.master.winfo_screenheight()        w = (useFactor and ws*width) or width        h = (useFactor and ws*height) or height        # calculate position x, y        x = (ws/2) - (w/2)         y = (hs/2) - (h/2)        self.master.geometry('%dx%d+%d+%d' % (w, h, x, y))         self.master.overrideredirect(True)        self.lift() if __name__ == '__main__':    root = Tk()     sp = SplashScreen(root)    sp.config(bg="#3366ff")     m = Label(sp, text="This is a test of the splash screen\n\n\nThis is only a test.\nwww.sunjay-varma.com")    m.pack(side=TOP, expand=YES)    m.config(bg="#3366ff", justify=CENTER, font=("calibri", 29))     Button(sp, text="Press this button to kill the program", bg='red', command=root.destroy).pack(side=BOTTOM, fill=X)    root.mainloop() 
 Fuente: http://code.activestate.com/recipes/577271-tkinter-splash-screen/ No sé si es posible hacer exactamente lo que pides. |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  |  |  
 
	
 
 
				
					
						| Mensajes similares |  
						|  | Asunto | Iniciado por | Respuestas | Vistas | Último mensaje |  
						|   |   | (Python/Tk) ocultar "marco  ventana" tk Scripting
 | tonilogar | 2 | 6,748 |  3 Diciembre 2009, 00:26 am por tonilogar
 |  
						|   |   | Ayuda con Python, ftp y Tkinter Scripting
 | Eirthur | 1 | 4,629 |  11 Mayo 2013, 03:56 am por daryo
 |  
						|   |   | Ayuda botones Tkinter Scripting
 | AlbertSerres | 2 | 3,535 |  23 Octubre 2013, 18:23 pm por Eleкtro
 |  
						|   |   | [Python + tkinter] Ayuda con botón de una ventana y tecla enter Python
 | darkweb64 | 3 | 7,328 |  13 Mayo 2015, 23:10 pm por tincopasan
 |  
						|   |   | [Python3 + tkinter] Ayuda ventanas en cascada tkinter Python
 | darkweb64 | 2 | 4,897 |  11 Diciembre 2015, 18:04 pm por darkweb64
 |    |