how to add a toolbar to a Frame using wxpython



hi
please am learning wxpython and I Need help on getting examles of how
to create a toolbar with images
that is add a toolbar to a Frame using wxpython
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!
my biggest trouble seems to be 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()

.



Relevant Pages

  • ANN: wxPython 2.7.1.1 released
    ... The 2.7.1.1 release of wxPython is now available for download at ... cases the native widgets are used on each platform. ... position of the window in screen coordinates, ... I've turned on the compile option for using the native toolbar ...
    (comp.lang.python)
  • ANN: wxPython 2.7.1.1 released
    ... The 2.7.1.1 release of wxPython is now available for download at ... cases the native widgets are used on each platform. ... position of the window in screen coordinates, ... I've turned on the compile option for using the native toolbar ...
    (comp.lang.python.announce)
  • Re: how to add a toolbar to a Frame using wxpython
    ... please am learning wxpython and I Need help on getting examles of how ... that is add a toolbar to a Frame using wxpython ... my biggest trouble seems to be with the IMAGES? ... If you need to create your own icons / bitmaps, I use the img2py ...
    (comp.lang.python)
  • Re: UI toolkits for Python
    ... I've just started playing with PyGTK+glade, ... > 4) Ease of installation/use on OS X? ... wxPython is good. ... related to dynamically creating toolbars and changing the toolbar. ...
    (comp.lang.python)
  • Re: WM2003SE toolbar bug-fix required
    ... Is this on a 2003 Second Edition device? ... > After having problems getting my toolbar to display images I've found ...
    (microsoft.public.pocketpc.developer)