Ver Mensaje Individual
  #9 (permalink)  
Antiguo 01/10/2008, 13:39
Avatar de David
David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Exclamación Respuesta: crear algo con phyton ayuda!

Mira, un código funcional:
Código python:
Ver original
  1. import wx
  2. ID_ABOUT =101
  3. ID_EXIT =110
  4.  
  5. class MainWindow(wx.Frame):
  6.     def __init__(self,parent,id,title):
  7.         wx.Frame.__init__(self,parent,wx.ID_ANY,title,size = (400,200),style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE )
  8.         self.control = wx.TextCtrl(self,1,style = wx.TE_MULTILINE)
  9.         #--- START NEW CODE: -----------------------------------------------------
  10.         self.CreateStatusBar()
  11.         #-------- Setting up the menu.
  12.         filemenu = wx.Menu()
  13.         filemenu.Append(ID_ABOUT, "&About","Information obout this program")
  14.         filemenu.AppendSeparator()
  15.         filemenu.Append(ID_EXIT, "E&xit" "terminate the program")
  16.         #-------- Creating the menu.
  17.         menubar = wx.MenuBar()
  18.         menubar.Append(filemenu,"&File")
  19.         self.SetMenuBar(menubar)
  20.         #--- END NEW CODE --------------------------------------------------------
  21.         self.Show(True)
  22.  
  23. app = wx.PySimpleApp()
  24. frame = MainWindow(None,-1,"universal grapics studio")
  25. app.MainLoop()
He corregido el mal uso de las mayúsculas. Además que deben ser dos guiones bajos (__) antes y después del init en ambos casos.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.