Nathan smith
unread,Nov 10, 2021, 7:33:01 PM11/10/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wxpytho...@googlegroups.com
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