Hi guys I am looking to create the following as shown below. Anybody able to give me a hand as im really struggling to make the rectangles different lengths.
Blackberryy
0
Newbie Poster
Recommended Answers
Jump to PostI don't have a lot of time, but here is a simple example to start you, using Tkinter. The other GUI toolkits, WxPython and QT, would be similar.
from Tkinter import * root = Tk() root.title('Rectangle Test') canvas = Canvas(root, width =300, height=300) ## top_left_x, top_left_y, bottom_right_x, …
Jump to PostThe middle rectangle, be it red or white is centered, so if you have a 200x200 canvas, the middle would be 100. You can then move left or right, calculating the end position of the first red square for the rows with 4 red squares; end position=middle - (1.5 white …
All 8 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
woooee
814
Nearly a Posting Maven
Blackberryy
0
Newbie Poster
Blackberryy
0
Newbie Poster
woooee
814
Nearly a Posting Maven
Gribouillis
1,391
Programming Explorer
Team Colleague
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
richieking
44
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.