0
root.title('Timeline Test')
root.geometry('1440x800')

menu = tk.Menu(root, tearoff=False)
menu.add_command(label="Some Action", command=lambda: print("Command Executed"))

timeline = TimeLine(
    root,
    categories={str(key): {"text": "Layer {}".format(key+1)} for key in range(0, 5)},
    height=100, extend=True, width=20
)

timeline.tag_configure("1", right_callback=lambda *args: print(args), menu=menu, foreground="green",
                       active_background="yellow", hover_border=2, move_callback=lambda *args: print(args))
timeline.create_marker("1", 1.0, 3.1415926535, background="white", text="Change Color", tags=("1",), iid="1")
timeline.create_marker("2", 2.0, 3.0, background="green", text="Change Category", foreground="white", iid="2",
                       change_category=True)
timeline.create_marker("3", 1.0, 2.0, text="Show Menu", tags=("1",))
timeline.create_marker("4", 4.0, 5.0, text="Do nothing", move=False)
timeline.draw_timeline()
timeline.pack(side='bottom', fill='both', expand=1)

root.mainloop()

When I ran this code, the timeline wouldn't expand entirely on the x-axis of the window. What's going on?

https://i.imgur.com/IfnJSEN.gif

0 Answers0