11. Tkinter: Notebook

Publié le: 08 avril 2020
sur la chaîne: Game Design with Reilly
499
4

Video code

from tkinter import*
from tkinter import ttk

currentTab = 0

def mKey(event):
global currentTab
if currentTab == 2:
currentTab=0
else:
currentTab = currentTab+1
Notebook.select(currentTab)

master=Tk()
master.title("My title")
master.configure(background='white')
master.geometry("350x200")
master.bind('m',mKey)

style = ttk.Style()
style.layout('TNotebook.Tab',[])
Notebook = ttk.Notebook(master, width = 400)
Tab1 = ttk.Frame(Notebook)
Notebook.add(Tab1, text="Show items")
Tab2 = ttk.Frame(Notebook)
Notebook.add(Tab2, text="Edit items")
Tab3 = ttk.Frame(Notebook)
Notebook.add(Tab3, text="Delete items")
Notebook.pack()

#Tab1
Tab1Label = Label(Tab1,text="This is tab 1")
Tab1Label.pack(side=TOP)
#Tab2
Tab2Label = Label(Tab2,text="This is tab 2")
Tab2Label.pack(side=TOP)


Sur cette page du site, vous pouvez voir la vidéo en ligne 11. Tkinter: Notebook durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Game Design with Reilly 08 avril 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 499 fois et il a aimé 4 téléspectateurs. Bon visionnage!