an issue with circles in circles

Nathan smith <[email protected]> Thu, 11 Nov 2021 00:32:56 +0000
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi there,


I'm having a little issue with drawing a circle within a circle, within 
a cirlce.

I've bound to the wx.EVT_PAINT event, have a black pen with width 4 and 
color black on a unmodified frame background.


The following code draws a box on the screen and splits it up the middle:

   size=self.GetClientSize()
   tpx=int(size.x/10)
   tpy=int(size.y/10)
   dc.DrawLine(tpx*2, tpy*2, tpx*8, tpy*2)
   dc.DrawLine(tpx*2, tpy*8, tpx*8, tpy*8)
   dc.DrawLine(tpx*2, tpy*2, tpx*2, tpy*8)
   dc.DrawLine(tpx*8, tpy*2, tpx*8, tpy*8)
   dc.DrawLine(tpx*5, tpy*2, tpx*5, tpy*8)


The following two variables set the center point for the left and right 
boxes.

   lc=[int(tpx*4), tpy*4]
   rc=[int(tpx*6), tpy*4]


I have a list of numbers like the following:

shells=[[4, []], [6, []], [8, []]


I then draw the circles as follows:

for x in shells:

  dc.DrawCircle(lc[0], lc[1], (size.x/100)*x[0])


When this code is run, it draws the first central circle when it is 
added, but the more circles i add to the list, instead of drawing circle 
B around Circle A, it deletes Circle A and just draws a bigger circle B.

Is this to do with overlapping backgrounds?

I'm confused!


Best,

Nathan

-- 
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/99130b06-b7dd-6df0-8da1-0d63491baa7b%40gmail.com.