Hi
I am writing a PAINT like application using python.I am new to python, am using wxpython for GUI. I have to create a toolbox for the (lines, circle etc etc options).Using the toolbar creation example from python wiki. But cannot understand how the addsimpletool works
import wx
class MyToolBar(wx.Frame): def init(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(350, 250))
vbox = wx.BoxSizer(wx.VERTICAL)
toolbar = wx.ToolBar(self, -1, style=wx.TB_VERTICAL | wx.NO_BORDER)
toolbar.AddSimpleTool(1,wx.Image('stock_new.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'New', '')
class MyApp(wx.App): def OnInit(self): frame = MyToolBar(None, -1, '') frame.Show(True) return True
app = MyApp(0) app.MainLoop()
Di I have to create the images in .png format. Is there any other way to do this? I hope someone can tell me how it works or point me to any documentation for it