-
Notifications
You must be signed in to change notification settings - Fork 0
/
ButtonTimeLine.py
32 lines (24 loc) · 1.1 KB
/
ButtonTimeLine.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from tkinter import *
from ButtonFragment import ButtonFragment
class ButtonTimeLine:
def __init__(self, gui, time_line):
self.time_line = time_line
self.gui = gui
self.last_column = 0
canvas = Canvas(self.gui.window, width=750, height=300)
canvas.place(x=300)
self.frame = Frame(canvas, bd=2)
self.frame.pack(side='left', fill='both', expand=True)
canvas.create_window((0, 0), window=self.frame, anchor='nw')
scrollbar = Scrollbar(self.gui.window, orient='horizontal',
command=canvas.xview)
scrollbar.place(relx=0.29, rely=0.54, relwidth=0.71, anchor='sw')
canvas.configure(xscrollcommand=scrollbar.set)
def on_frame_configure(event):
canvas.configure(scrollregion=canvas.bbox('all'))
self.frame.bind('<Configure>', on_frame_configure)
def update(self):
for child in self.frame.winfo_children():
child.destroy()
for fragment in self.time_line.time_line:
ButtonFragment(self.gui, self, fragment)