0

quisiera abrir una ventana, sin los botones ni el titulo y alli desplegar un menú, he probado overrideredirect(True), pero no me aparece la linea de menú, probe con -fullscreen','true' como lo suguiere https://stackoverflow.com/questions/39529600/remove-titlebar-without-overrideredirect-using-tkinter y si funciona, me aparece el menú sin la barra de comando tkinter, pero me maximiza la ventana y no consigo que lo haga en la ventana que he definido, acá dejo mi código a ver si me pueden ayudar, orientar, Gracias de antemano.

Acá defino ventana, como pueden observar en la lineas de comentario he probado varia opciones.

   try:
        self.tree3.item(self.tree3.selection())['values'][0]
    except IndexError as e:
        messagebox.showinfo("A T E N C I O N ! ! !", "Selecciones una FECHA, por favor!")
        return
    self.windows_fx_consulta = Toplevel()
    self.windows_fx_consulta.transient(self.windows_consulta1)
    self.windows_fx_consulta.resizable(width=False, height=False)
    self.windows_fx_consulta.resizable(0,0)
    #   Medidas del Geometry ("ancho x alto + columna + fila")
    self.windows_fx_consulta.geometry("560x258+254+305")
    self.windows_fx_consulta.wm_attributes('-fullscreen','true')
    #self.windows_fx_consulta.protocol('WM_DELETE_WINDOW', self.on_exit) # Invalidar x y mandar a función con mensaje 
    #fondo = tk.Label(self.windows_fx_consulta, image=self.photo_consulta2, background="ivory2")
    #fondo = tk.Label(self.windows_fx_consulta, background="SkyBlue3")
    #fondo.place(x=0, y=0, relwidth=1, relheight=1)
    self.rx_tipo=''
    #self.windows_fx_consulta.update_idletasks()
    #self.windows_fx_consulta.overrideredirect(True)
    self.menufx()

Creo el menú

# Crear el menu principal
def menufx(self):
    Label(self.windows_fx_consulta, text = 'Use menú para escoger RX', background='navy', foreground = 'LightSkyBlue3', 
        font = ('arial', 20, 'bold')).place(x =100, y = 100)
  
    menubarra = Menu(self.windows_fx_consulta)
    # Crea un menu desplegable y lo agrega al menu barra
    menufx = Menu(menubarra, tearoff=0)
    menubarra.add_cascade(label="RX Aerea", menu=menufx)
    menufx.add_command(label="RX Actual", command=self.fx_actual, foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    menufx.add_command(label="Rx Auto - Refracción", command=self.fx_auto, foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    menufx.add_command(label="Rx Subjetivo", command=self.fx_suge, foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    #menufx.add_separator()
    menudoctor = Menu(menubarra, tearoff=0)
    menubarra.add_cascade(label="RX Lente de Contacto", menu=menudoctor)
    menudoctor.add_command(label="Rx Prueba", command=self.hola, foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    menudoctor.add_command(label="Rx Definitivo", command=self.hola, foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    menufx1 = Menu(menubarra, tearoff=0)
    menubarra.add_cascade(label="Volver al Menú Consulta", menu=menufx1)
    menufx1.add_command(label="Volver...", command=lambda : self.windows_fx_consulta.destroy(), foreground = 'navy', background="LightSkyBlue3", font = ('arial', 14, 'bold'))
    # Mostrar el menu
    self.windows_fx_consulta.config(menu=menubarra)
2

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.