create a toolbar + images using wxpython for windows
yadin Bocuma Rivas
conra2004 at yahoo.com
Tue Jul 31 09:07:44 EDT 2007
hi everery one
I Need help on getting examles of how to create a toolbar with images
using wxpython on a windows pc
how can i add a toolbar to a GUI
all sample codes i could find contain errors.
i did the following but it is wrong!
what is it with the IMAGES? do i have to create them, load them...? or they come with python like in Matlab
thank you.
import wx
from pylab import*
class MainWindow(wx.Frame):
def __init__(self,parent,id,title):
self.dirname=''
wx.Frame.__init__(self,parent,wx.ID_ANY, title,wx.DefaultPosition, wx.Size(320,410))
##############_______________________ADDING A TOOLBAR___________________######################
toolbar = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL | wx.NO_BORDER)
toolbar.AddSimpleTool(1, wx.Image('stock_new.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'New', '')
toolbar.Realize()
Frame.Add(toolbar, 0, border=5)
app = wx.PySimpleApp()
frame = MainWindow(None, -1, " dipole antenna ")
frame.show(1)
frame.SetBackgroundColour('light grey')
app.MainLoop()
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070731/6c89cbe9/attachment.html>
More information about the Python-list
mailing list