I understand that this is a very simple question, but how do you draw a triangle using
wxpython? A simple example would be much appreciated.
I tried using
dc.DrawPolygon(self, points, xoffset, yoffset, fillStyle), but I didn't know what to pass in for
fillstyle. All my efforts resulted in odd error messages.
Sorry for such a novice question!
Best How To :
As the docs say:
The last argument specifies the fill rule:
wx.ODDEVEN_RULE (the default) or
So, those are the only two values you can pass for
fillstyle. If you pass anything else, you'll probably get an exception.
But notice that it has a perfectly good default. If you're drawing complicated concave polygons sometimes you need the other rule. (If that comes up, you will have to learn what the two rules mean; I don't think the
wx docs cover it, but Wikipedia might be a good place to start.) But most of the time, you can just leave it off and use the default:
my_dc.DrawPolygon(my_points, my_xoffset, my_yoffset)