It's very simple! In this video, I demonstrate how to create a start page in python using Tkinter. I show the basics of Tkinter, such as creating a window, building buttons, changing the font and colour.
I hope you guys find this video helpful. Feel free to like, comment, subscribe, and share this video. Thank you!
Steps:
1. Import all necessary libraries
2. Create a function that opens up the start page
3. Initiate Tkinter window
4. Edit Tkinter window (title, geometry, etc)
5. Create font style
6. Create and configure buttons
7. Execute python file
Code used in this video:
from tkinter import *
import tkinter as tk
import tkinter.font as font
def open_start_window():
start_window = Tk()
start_window.title('start window')
start_window.geometry('400x300')
def gallery_page():
print("the gallery is now open")
def exit_window():
start_window.destroy()
gallery_button = tk.Button(text='Open Gallery', bg='blue', fg='red', command=gallery_page)
font_style = font.Font(family='Arial', size=15, weight='bold')
gallery_button['font'] = font_style
gallery_button.config(height=5, width=20)
gallery_button.pack()
exit_button = tk.Button(text='Exit', command=exit_window)
exit_button.place(x=180, y=200)
start_window.mainloop()
open_start_window()