13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong> Graphics Device Interfacehttp://www.zetcode.com/wxpython/gdi/Figure: Custom PatternsBasic primitivesPoint<strong>The</strong> simplest geometrical object is a point. It is a plain dot onthe window.DrawPoint(int x, int y)This method draws a point at x, y coordinates.#!/usr/bin/python# points.pyimport wximport randomclass Points(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(250, 150))self.Bind(wx.EVT_PAINT, self.OnPaint)self.Centre()self.Show(True)18 de 44 27/04/2008 1:08

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!