Ver Mensaje Individual
  #26 (permalink)  
Antiguo 03/10/2008, 16:09
iozk
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 16 años, 2 meses
Puntos: 1
Respuesta: crear algo con phyton ayuda!

ayudame con esto porfabor esque el area de texto esta en la barra del boxSizer
y no se como llego alli

aqui esta

Cita:
import wx

ID_STAT = 1
ID_TOOL = 2
ID_QUIT = 3

class CheckMenuItem(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size = (400,400),style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE )
self.control = wx.TextCtrl(self,1,style = wx.TE_MULTILINE)

vbox = wx.BoxSizer(wx.VERTICAL)

toolbar1 = wx.ToolBar(self, -1)
toolbar1.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('wamp/select.png'))
toolbar1.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('wamp/pen.png'))
toolbar1.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('wamp/text.png'))
toolbar1.Realize()

toolbar2 = wx.ToolBar(self, -1)
toolbar2.AddLabelTool(wx.ID_EXIT, '', wx.Bitmap('wamp/exit.png'))
toolbar2.Realize()

vbox.Add(toolbar1, 0, wx.EXPAND)
vbox.Add(toolbar2, 0, wx.EXPAND)

self.Bind(wx.EVT_TOOL, self.OnExit, id=wx.ID_EXIT)

menubar = wx.MenuBar()
file = wx.Menu()
file.Append(-1, '&New')
file.Append(-1, '&Open')
file.Append(-1, '&Save')
file.AppendSeparator()

imp = wx.Menu()
imp.Append(-1, 'Import newsfeed list...')
imp.Append(-1, 'Import bookmarks...')
imp.Append(-1, 'Import mail...')

file.AppendMenu(-1, 'I&mport', imp)

quit = wx.MenuItem(file, ID_QUIT, '&Quit\tCtrl+W')
quit.SetBitmap(wx.Bitmap('wamp/exit.png'))
file.AppendItem(quit)


self.Bind(wx.EVT_MENU, self.OnQuit, id=ID_QUIT)

view = wx.Menu()
self.shst = view.Append(ID_STAT, 'Show statubar', 'Show Statusbar', kind=wx.ITEM_CHECK)
self.shtl = view.Append(ID_TOOL, 'Show toolbar', 'Show Toolbar', kind=wx.ITEM_CHECK)
view.Check(ID_STAT, True)
view.Check(ID_TOOL, True)

self.Bind(wx.EVT_MENU, self.ToggleStatusBar, id=ID_STAT)
self.Bind(wx.EVT_MENU, self.ToggleToolBar, id=ID_TOOL)

menubar.Append(file, '&File')
menubar.Append(view, '&View')
self.SetMenuBar(menubar)

self.toolbar = self.CreateToolBar()
self.toolbar.AddLabelTool(3, '', wx.Bitmap('wamp/exit.png'))
self.toolbar.Realize()

self.SetSizer(vbox)
self.statusbar = self.CreateStatusBar()
self.Centre()
self.Show(True)

def OnExit(self, event):
self.Close()

def OnQuit(self, event):
self.Close()

def ToggleStatusBar(self, event):
if self.shst.IsChecked():
self.statusbar.Show()
else:
self.statusbar.Hide()

def ToggleToolBar(self, event):
if self.shtl.IsChecked():
self.toolbar.Show()
else:
self.toolbar.Hide()

app = wx.App()
CheckMenuItem(None, -1, 'check menu item')
app.MainLoop()