How do I draw a semicircle?

Phil <[email protected]> Thu, 13 May 2021 14:50:30 +1000
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Thank you for reading this.

I'm trying to create an analogue meter. So far I have a pointer that 
moves and now I'm trying to create a dial face. Just for the sake of 
simplicity, the dial face is a semicircle.

I've spent a lot of time experimenting and searching for an answer 
without success. The following is based on something that I found, it 
runs but doesn't draw anything:

     def OnPaint(self, e):

         #pdc = wx.PaintDC(self)
         #gc = wx.GCDC(pdc)

         gc = wx.GraphicsContext.Create(wx.PaintDC(self))

         path = gc.CreatePath()

         path.AddArc(450, 100, 30, math.radians(180), math.radians(0))
         pen = wx.Pen('#ffffff', 1)
         gc.SetBrush(wx.Brush('#CC7F32', wx.SOLID))
         gc.SetPen(pen)

         gc.DrawPath(path)

-- 
Regards,
Phil

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/123c0aed-fbfe-012f-091f-7521a9abada8%40gmail.com.