from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
def next():
print('weiter gehts')
root=Tk()
root.geometry('500x100')
#resizing the image
root.next = Image.open('next.png')
root.next = root.next.resize((40,40),Image.ANTIALIAS)
root.next=ImageTk.PhotoImage(root.next)
b1=ttk.Button(text='weiter_1',image=root.next,compound=BOTTOM, command=lambda:next()).pack(side=LEFT)
b2=ttk.Button(text='weiter_2',image=root.next,compound=TOP, command=lambda:next()).pack(side=LEFT)
b3=ttk.Button(text='weiter_3',image=root.next,compound=LEFT, command=lambda:next()).pack(side=LEFT)
b4=ttk.Button(text='weiter_4',image=root.next,compound=RIGHT, command=lambda:next()).pack(side=LEFT)
b5=ttk.Button(text='weiter_5',image=root.next,compound=NONE, command=lambda:next()).pack(side=LEFT)
b6=ttk.Button(text='weiter_6',image='',compound=BOTTOM, command=lambda:next()).pack(side=LEFT)
root.mainloop()
|