hello great community of developers, I have a problem with my code. I am new ...

wx.panel want to put () to the main mdi window code.

and I would like to know how to open and close a main module is

mainly run and then open medi.py nada.py

and close nada.py

please help ..

#!usr/bin/python

#nada.py

import wx

class MDIFrame(wx.MDIParentFrame):
    def __init__(self, parent, id, title):
        wx.MDIParentFrame.__init__(self, parent, id, title, size=(1024,768))
        panelw = wx.Panel(self, -1, pos = (0,0))
        
        #Ventana hija de prueba Mdi
        self.Ventana = wx.MDIChildFrame(self, -1, "Comprobación de Usuario", size = (400,400), pos = (300,200), style = wx.CAPTION | wx.RESIZE_BORDER |wx.SYSTEM_MENU)
        #panel
        panel = wx.Panel(self.Ventana, -1, pos = (0,0))
        #textos estaticos
        usuario = wx.StaticText(panel, -1, "USUARIO", pos = (100,100))
        clave = wx.StaticText(panel, -1, "PASSWORD", pos = (100,140))
        #cajs de texto
        usuariob = wx.TextCtrl(panel, -1, "", pos = (170,100))
        claveb = wx.TextCtrl(panel, -1, "", pos = (170,140), style = wx.PASSWORD)
        #botones
        self.Boton = wx.Button(panel, -1, "Cerrar", size = (100,100), pos = (200,200))
        self.Aceptar = wx.Button(panel, -1, u"Aceptar", size = (100,100), pos = (90,200))
        self.Boton.Bind(wx.EVT_BUTTON, self.OnExit)
        self.Aceptar.Bind(wx.EVT_BUTTON, self.OnAceptar)
        self.Ventana.Centre(True)
        self.Ventana.Center(True)
        self.Ventana.Show()

    def OnExit(self, evt):
        self.Close(True)

    def OnAceptar(self, evt):
        from MEDI import Recibo
        

app = wx.PySimpleApp()
frame = MDIFrame(None, -1, "Prueba de ventana MDI")
frame.Maximize()
frame.Show()
app.MainLoop()
import wx


class Recibo(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size = (500,400))
        panel = wx.Panel(self, -1)
        #Textos_Estaticos...
        centrocli = wx.StaticText(panel, -1, "Centro Clinico Los Angeles,CA ", pos = (10,10))
        fecha = wx.StaticText(panel, -1, "Fecha: ", pos = (200,10))
        recipago = wx.StaticText(panel, -1, "Recibo de Pago", pos = (10,30))
        bs = wx.StaticText(panel, -1, "Bs: ", pos = (200,30))
        nombre = wx.StaticText(panel, -1, "Nombres: ", pos = (10,50))
        ci = wx.StaticText(panel, -1, "Cedula: ", pos = (200,50))
        dpto = wx.StaticText(panel, -1, "Departamento: ", pos = (10,70))
        conforme = wx.StaticText(panel, -1, "He recibido de Centro Clinico Los Angeles la cantidad de: ", pos = (10,90))
        concepto = wx.StaticText(panel, -1, "Concepto: Pago Primera Quincena del mes de: ", pos = (10,110))
        asignaciones = wx.StaticText(panel, -1, "Asignaciones", pos = (10,130))
        self.Show()
        
        
app = wx.App()
Recibo(None, -1, "")
app.MainLoop()

I do not see problem running them by import from main script. This would not work if you need to run the modules multiple times. If that is case you must transfer the initializations to function which you can run as many times as you like. This with recervation that I mainly use tkinyer for GUI.

thanks for your answer is very friendly.
correct me understand what you mean

my problem is knowing how to open

def OnAceptar(self, evt):
        from MEDI import Recibo

and close #nada.py

and close the previous window open

This article has been dead for over six months. Start a new discussion instead.