Ver Mensaje Individual
  #17 (permalink)  
Antiguo 01/10/2008, 21:29
iozk
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 15 años, 11 meses
Puntos: 1
Respuesta: crear algo con phyton ayuda!

como le pongo acciones a los menus

Cita:
import wx
ID_ABOUT = 101
ID_OPEN = 110
ID_EXIT =110
ID_COPY = 120
ID_TOOLS = 100
ID_HELP = 120

class MainWindow(wx.Frame):
def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size = (400,200),style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE )
self.control = wx.TextCtrl(self,1,style = wx.TE_MULTILINE)
#---START NUEW CODE:--------------------------------------
self.CreateStatusBar()
#-------- Setting up the menu.
filemenu = wx.Menu()
filemenu.Append(ID_ABOUT, "&About","Information obout this program")
filemenu.Append(ID_OPEN, "O&pen", "Abrir archivo")
filemenu.AppendSeparator()
filemenu.Append(ID_EXIT, "E&xit", "terminate the program")
editmenu = wx.Menu()
editmenu.Append(ID_COPY,"Cop&y", "copiar texto")
toolmenu = wx.Menu()
toolmenu.Append(ID_TOOLS, "&Tool", "Herramientas del programa")
helpmenu = wx.Menu()
helpmenu.Append(ID_HELP, "&Help", "ayuda")
#-------- Creating the menu.
menubar = wx.MenuBar()
menubar.Append(filemenu,"&File")
self.SetMenuBar(menubar)
menubar.Append(editmenu, "&Edit")
self.SetMenuBar(menubar)
menubar.Append(toolmenu, "&Tool")
self.SetMenuBar(menubar)
menubar.Append(helpmenu, "&Help")
self.SetMenuBar(menubar)
#--- END NEW CODE --------------------------------------------------------
self.Show(True)

app = wx.PySimpleApp()
frame = MainWindow(None,-1,"universal grapics studio")
frame.Show(1)
app.MainLoop()
si me pudieran analisar el codigo porque en exit no me dice lo que tiene que decir en la barra de estado y en help dice copiar texto y en exit dice abrir archivo porf

Última edición por iozk; 01/10/2008 a las 21:36 Razón: un incombeniente mas XD