[其他]代码库
def control_panel():
width, height = 400, 380
win = GraphWin('Welcome to:', width, height, autoflush=False)
win.setBackground('light grey')
label_bg = Rectangle(Point(0, 0), Point(width, 40))
label_bg.setFill('black')
label_bg.draw(win)
draw_text(win, Point(200, 20), 'GUESS MASTER 2.0', 'gold', 20, 'bold')
btn_width, btn_height = 80, 40
new_pt = Point(15, 60)
# create new button
new_rect = Rectangle(new_pt, Point(new_pt.getX() + btn_width, new_pt.getY() + btn_height))
new_rect.setFill('yellow')
new_rect.draw(win)
draw_text(win, new_rect.getCenter(), 'NEW', 'black', 18, 'bold')
[代码运行效果截图]
[源代码打包下载]