[Tutor] wxpython button icons?
Christian Wyglendowski
Christian.Wyglendowski at greenville.edu
Tue May 31 16:52:58 CEST 2005
Hey Jeff,
> -----Original Message-----
> From: tutor-bounces at python.org
> [mailto:tutor-bounces at python.org] On Behalf Of Jeff Peery
>
> Hello, does anyone know if there is a list of widows icons
> available? I'm creating an application for windows and I'd
> like to use standard icons for things like a "print" button
> or "save" button etc. thanks.
Checkout "images.py" in the wxPython demo directory. If you put it in
your python path somewhere you can do an "import images" and then write
code like this (grabbed from the wxPython toolbar demo):
<pythoncode>
tb = self.CreateToolBar( wx.TB_HORIZONTAL
| wx.NO_BORDER
| wx.TB_FLAT
| wx.TB_TEXT
)
tb.AddSimpleTool(10, images.getNewBitmap(), "New", "Long help
for 'New'")
self.Bind(wx.EVT_TOOL, self.OnToolClick, id=10)
self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=10)
tb.AddSimpleTool(20, images.getOpenBitmap(), "Open", "Long help
for 'Open'")
self.Bind(wx.EVT_TOOL, self.OnToolClick, id=20)
self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=20)
</pythoncode>
There are probably other ways to do this as well, but there's my .02!
Christian
http://www.dowski.com
More information about the Tutor
mailing list