Ejemplo n.º 1
0

def remove_frames():
    for frame in frame_list:
        frame.grid_remove()


cost_group = StringVar(root)
cost_group.set(GF.cost_options[0])
cost_menu = ttk.Combobox(fr4, values=GF.cost_options)
cost_menu.set(cost_group.get())
cost_menu.grid(row=0, column=0, pady=(30, 10), padx=(40, 30))

text_area = Listbox(fr2, width=28, height=34, state='normal')
text_area.grid(row=0, column=0, rowspan=20)
MF.refresh(text_area)

x = 0
for champ in DCF.champion_list:

    GF.images.append(
        ImageTk.PhotoImage(
            Image.open(champ.image).resize((59, 59)), Image.ANTIALIAS))

    b = Button(fr,
               image=GF.images[-1],
               command=lambda x=champ: MF.increment(x, text_area),
               highlightthickness=0,
               bd=0)
    b.grid(row=math.floor(x / 5), column=x % 5)
    x += 1
Ejemplo n.º 2
0
def change_context(button, listbox):
    DCL.is_champ = not DCL.is_champ
    button.config(text='Traits' if DCL.is_champ else "Champions")
    MF.refresh(listbox)