Principiante
Mario Lacunza
mlacunza en spymac.com
Dom Ago 22 01:57:55 CEST 2004
Hola Amigos:
Recien me estoy iniciando con el Python, programo en otros lenguajes
especialmente en VB
Quisiera q me den una mano sobre q herramientas visuales debo tener o
cuales recomiendan para desarrollar aplicaciones a traves de este lenguaje.
De antemano gracias!!
Saludos / Best regards
Mario Lacunza
Email: mlacunza en spymac.com
Lima - Peru
Ariel Nardelli wrote:
> Hola.
>
> Aca estoy experimentando con wx.Python y me esta surgiendo un problema
> que no le encuentro solucion y no logro darme cuenta cual puede ser el
> problema...
>
> Con WxGlade hice una aplicacion con 2 frames, uno que llama el
> segundo, el principal es el frame queda y el frame que se carga dentro
> del principal es el frame hijo.
>
> Pero cuando lo ejecuto me da un error cuando me tiene que llamar a una
> funcion que esta definida, el error es:
>
> Traceback (most recent call last):
> File "/mnt/python/wxnar/queda.py", line 67, in ?
> cinco = Mycinco(0)
> File "/usr/lib/python2.3/site-packages/wxPython/wx.py", line 1951, in
> __init__
> _wxStart(self.OnInit)
> File "/mnt/python/wxnar/queda.py", line 59, in OnInit
> frame_1 = queda(None, -1, "")
> File "/mnt/python/wxnar/queda.py", line 29, in __init__
> EVT_MENU(self, 101 , self.hijo)
> AttributeError: queda instance has no attribute 'hijo'
>
> Realmente estube mirando y no encuentro cual puede ser el error, es
> evidente que estoy definiendo algo mal pero no encuentro..., si
> alguien ve el error y me lo dice se lo voy a agradecer!!!
>
> Estoy en python2.3, con linux.
>
> Aca van los dos fuentes, pelados tal cual lo crea el wxglade...
>
> # generated by wxGlade 0.3.3 on Fri Aug 20 17:39:17 2004
>
> from wxPython.wx import *
>
> # begin wxGlade: dependencies
> # end wxGlade
>
> class queda(wxFrame):
> def __init__(self, *args, **kwds):
> # begin wxGlade: queda.__init__
> kwds["style"] = wxDEFAULT_FRAME_STYLE
> wxFrame.__init__(self, *args, **kwds)
> # Menu Bar
> self.queda_menubar = wxMenuBar()
> self.SetMenuBar(self.queda_menubar)
> self.MenuPrueba = wxMenu()
> self.MenuPrueba.Append(101, "MPrueba", "es una prueba",
> wxITEM_NORMAL)
> self.queda_menubar.Append(self.MenuPrueba, "Prueba")
> self.Salir = wxMenu()
> self.queda_menubar.Append(self.Salir, "Salir")
> # Menu Bar end
> self.queda_statusbar = self.CreateStatusBar(1, 0)
>
> self.__set_properties()
> self.__do_layout()
> # end wxGlade
>
> EVT_MENU(self, 101 , self.hijo) # Aca es donde me da el error!!!!
>
> def __set_properties(self):
> # begin wxGlade: queda.__set_properties
> self.SetTitle("Queda")
> self.queda_statusbar.SetStatusWidths([-1])
> # statusbar fields
> queda_statusbar_fields = ["queda_statusbar"]
> for i in range(len(queda_statusbar_fields)):
>
> self.queda_statusbar.SetStatusText(queda_statusbar_fields[i], i)
> # end wxGlade
>
> def __do_layout(self):
> # begin wxGlade: queda.__do_layout
> self.Layout()
> # end wxGlade
>
> def hijo(self, event):
> from hijo import hijo
> dialog = hijo(self, -1, "")
> dialog.CentreOnParent()
> dialog.ShowModal()
> dialog.Destroy()
> # end of class queda
>
>
> class Mycinco(wxApp):
> def OnInit(self):
> wxInitAllImageHandlers()
> frame_1 = queda(None, -1, "")
> self.SetTopWindow(frame_1)
> frame_1.Show(1)
> return 1
>
> # end of class Mycinco
>
> if __name__ == "__main__":
> cinco = Mycinco(0)
> cinco.MainLoop()
>
>
> Y la class donde esta el hijo es:
>
> from wxPython.wx import *
>
> # begin wxGlade: dependencies
> # end wxGlade
>
> class hijo(wxMDIChildFrame):
> def __init__(self, *args, **kwds):
> # begin wxGlade: hijo.__init__
> kwds["style"] = wxDEFAULT_FRAME_STYLE
> wxMDIChildFrame.__init__(self, *args, **kwds)
> self.label_1 = wxStaticText(self, -1, "label_1")
> self.label_2 = wxStaticText(self, -1, "label_2")
> self.combo_box_1 = wxComboBox(self, -1, choices=[],
> style=wxCB_DROPDOWN|wxCB_READONLY|wxCB_SORT)
> self.label_3 = wxStaticText(self, -1, "label_3")
> self.text_ctrl_1 = wxTextCtrl(self, -1, "")
> self.button_1 = wxButton(self, -1, "button_1")
> self.label_4 = wxStaticText(self, -1, "label_4")
> self.text_ctrl_2 = wxTextCtrl(self, -1, "")
> self.label_5 = wxStaticText(self, -1, "label_5")
> self.text_ctrl_3 = wxTextCtrl(self, -1, "")
> self.label_6 = wxStaticText(self, -1, "label_6")
> self.text_ctrl_4 = wxTextCtrl(self, -1, "")
> self.label_7 = wxStaticText(self, -1, "label_7")
> self.text_ctrl_5 = wxTextCtrl(self, -1, "")
>
> self.__set_properties()
> self.__do_layout()
> # end wxGlade
>
> def __set_properties(self):
> # begin wxGlade: hijo.__set_properties
> self.SetTitle("Hijito")
> self.combo_box_1.SetSelection(-1)
> # end wxGlade
>
> def __do_layout(self):
> # begin wxGlade: hijo.__do_layout
> grid_sizer_1 = wxGridSizer(2, 2, 1, 1)
> grid_sizer_3 = wxGridSizer(4, 2, 0, 0)
> grid_sizer_2 = wxGridSizer(2, 2, 0, 0)
> grid_sizer_1.Add(self.label_1, 0, wxALL, 3)
> grid_sizer_2.Add(self.label_2, 0, wxALL, 3)
> grid_sizer_2.Add(self.combo_box_1, 0, wxALL, 3)
> grid_sizer_2.Add(self.label_3, 0, wxALL, 3)
> grid_sizer_2.Add(self.text_ctrl_1, 0, wxALL, 3)
> grid_sizer_1.Add(grid_sizer_2, 1, wxEXPAND, 0)
> grid_sizer_1.Add(self.button_1, 0, wxALL, 3)
> grid_sizer_3.Add(self.label_4, 0, wxALL, 3)
> grid_sizer_3.Add(self.text_ctrl_2, 0, wxALL, 3)
> grid_sizer_3.Add(self.label_5, 0, wxALL, 3)
> grid_sizer_3.Add(self.text_ctrl_3, 0, wxALL, 3)
> grid_sizer_3.Add(self.label_6, 0, wxALL, 3)
> grid_sizer_3.Add(self.text_ctrl_4, 0, wxALL, 3)
> grid_sizer_3.Add(self.label_7, 0, wxALL, 3)
> grid_sizer_3.Add(self.text_ctrl_5, 0, wxALL, 3)
> grid_sizer_1.Add(grid_sizer_3, 1, wxEXPAND, 0)
> self.SetAutoLayout(1)
> self.SetSizer(grid_sizer_1)
> grid_sizer_1.Fit(self)
> grid_sizer_1.SetSizeHints(self)
> self.Layout()
> # end wxGlade
>
> # end of class hijo
>
>
>
>
>
> _______________________________________________
> Python-es mailing list
> Python-es en aditel.org
> http://listas.aditel.org/listinfo/python-es
>
>
> ---
> avast! Antivirus: Correo Entrante, El Mensaje no contiene virus.
> Base de datos de Virus (VPS): 0434-2, 20/08/2004
> Comprobado en: 20/08/2004 05:13:33 p.m.
> avast! tiene los derechos reservados (c) 2000-2004 ALWIL Software.
> http://www.avast.com
>
>
>
>
---
avast! Antivirus: Correo Saliente, El Mensaje no contiene virus.
Base de datos de Virus (VPS): 0434-2, 20/08/2004
Comprobado en: 23/08/2004 10:39:26 a.m.
avast! tiene los derechos reservados (c) 2000-2004 ALWIL Software.
http://www.avast.com
Más información sobre la lista de distribución Python-es