tkinter

 from tkinter import Tk, Text, Canvas

import tkinter as tk

from tkinter import ttk


win = tk.Tk()

screen_width = win.winfo_screenwidth()

screen_height = win.winfo_screenheight()

win.geometry(f"{screen_width}x{screen_height}")

win.title("notepad")


text = tk.Text(win, height=42, width=170)

text.pack(side=tk.LEFT, fill = tk.BOTH, expand=True)


scrollbar = tk.Scrollbar(win, command=text.yview)

scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

text.config(yscrollcommand=scrollbar.set)



def replace_win():

    outer_frame = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame.place(x=5, y=0, width=270, height=140)

    

    find = tk.Label(text = "Find:",borderwidth = 1, relief = "solid" )

    replace = tk.Label(text = "Replace:", borderwidth = 1, relief = "solid" )

    find_entry = tk.Entry(borderwidth = 1, relief = "solid" )

    replace_entry = tk.Entry(borderwidth = 1, relief = "solid" )

    btn1 = tk.Button(win, text = "Find next", width = 8, height = 1, cursor = "hand2", borderwidth = 3, relief = "ridge", pady = 3)

    btn2 = tk.Button(win, text = "Replace", width = 8, height = 1, cursor = "hand2" , borderwidth = 3, relief = "ridge", pady = 3)

    btn3 = tk.Button(win, text = "Replace all", width = 8, height = 1, cursor = "hand2", borderwidth = 3, relief = "ridge", pady = 3)

    btn4 = tk.Button(win, text = "Cancel", width = 8, height = 1, cursor = "hand2", borderwidth = 3, relief = "ridge", pady = 3)


    checkbox_var = tk.StringVar()

    checkbox1 = tk.Checkbutton(win,text='Match Case',variable=checkbox_var, borderwidth = 1, relief = "solid" )

    checkbox2 = tk.Checkbutton(win,text='Wrap around',variable=checkbox_var, borderwidth = 1, relief = "solid" )



    find.place(x=10, y=10)

    replace.place(x=10, y=40) 

    find_entry.place(x=70, y=10)  

    replace_entry.place(x=70, y=40)  

    btn1.place(x=200, y=10)  

    btn2.place(x=200, y=40)  

    btn3.place(x=200, y=70) 

    btn4.place(x=200, y=100) 

    checkbox1.place(x=10, y=70)  

    checkbox2.place(x=10, y=100)  



def file_func():

    outer_frame1 = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame1.place(x=0, y=25, width=206, height=202)

    

    new = tk.Button(win, text = "New                                  Ctrl+N", height = 1, width = 25)

    new_win = tk.Button(win, text = "New Window        Ctrl+Shift+N", height = 1, width = 25)

    opn = tk.Button(win, text = "Open                                Ctrl+O", height = 1, width = 25)

    save = tk.Button(win, text = "Save                                   Ctrl+S", height = 1, width = 25)

    save_as = tk.Button(win, text = "Save as                    Ctrl+Shift+S", height = 1, width = 25)

    page_stup = tk.Button(win, text = "Page Setup                                    ",  height = 1, width = 25)

    prnt = tk.Button(win, text = "Print                                               ", height = 1, width = 25)

    ext = tk.Button(win, text = "Exit                                                 ", height = 1, width = 25)

    

    new.place(x = 20, y = 25)

    new_win.place(x = 20, y = 50)

    opn.place(x = 20, y = 75)

    save.place(x = 20, y = 100)

    save_as.place(x = 20, y = 125)

    page_stup.place(x = 20, y = 150)

    prnt.place(x  = 20, y = 175)

    ext.place(x = 20, y = 200)

     

file_btn = tk.Button(win, text = "File", relief = "flat", command = file_func)

file_btn.place(x = 0, y = 0)


def edit_func():

    outer_frame1 = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame1.place(x=29, y=25, width=110, height=327)

    undo = tk.Button(win, text = "Undo", height = 1, width = 14)

    cut = tk.Button(win, text = "Cut", height = 1, width = 14)

    copy = tk.Button(win, text = "Copy", height = 1, width = 14)

    paste = tk.Button(win, text = "Paste", height = 1, width = 14)

    delete = tk.Button(win, text = "Delete", height = 1, width = 14)

    search_with_bing = tk.Button(win, text = "Search with Bing...", height = 1, width = 14)

    find = tk.Button(win, text = "Find", height = 1, width = 14)

    find_next = tk.Button(win, text = "Find Next", height = 1, width = 14)

    find_previous = tk.Button(win, text = "Find previous", height = 1, width = 14)

    replace = tk.Button(win, text = "Replace", height = 1, width = 14)

    go_to = tk.Button(win, text = "Go to", height = 1, width = 14)

    select_all = tk.Button(win, text = "Select All", height = 1, width = 14)

    time_date = tk.Button(win, text = "Time/Date", height = 1, width = 14)


    undo.place(x = 30  , y = 25)

    cut.place(x = 30 , y = 50)

    copy.place(x = 30 , y = 75)

    paste.place(x = 30 , y = 100)

    delete.place(x = 30 , y = 125)

    search_with_bing.place(x = 30 , y = 150)

    find.place(x =  30, y = 175)

    find_next.place(x = 30 , y = 200)

    find_previous.place(x = 30 , y = 225)

    replace.place(x = 30 , y = 250)

    go_to.place(x = 30 , y = 275)

    select_all.place(x = 30 , y = 300)

    time_date.place(x = 30 , y = 325)


edit_btn = tk.Button(win, text = "Edit", relief = "flat", command = edit_func)

edit_btn.place(x = 40, y = 0)


def format_func():

    outer_frame1 = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame1.place(x=29, y=25, width=100, height=52)

    word_wrap = tk.Checkbutton(win, text = "  Word Wrap...", height = 1, width = 10)

    font = tk.Checkbutton(win, text = "Font                  ", height = 1, width = 10)

    

    word_wrap.place(x = 30, y = 25)

    font.place(x = 30, y = 50)


format_btn = tk.Button(win, text = "Format", relief = "flat", command = format_func)

format_btn.place(x = 85, y = 0)


def view_func():

    outer_frame1 = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame1.place(x=35, y=25, width=90, height=52)

    zoom = tk.Button(win, text = "Zoom", height = 1, width = 10)

    status_bar = tk.Button(win, text = "Status Bar", height = 1, width = 10)

    

    zoom.place(x = 40, y = 25)

    status_bar.place(x = 40, y = 50)


view_btn = tk.Button(win, text = "View", relief = "flat", command = view_func)

view_btn.place(x = 150, y = 0)


def  help_func():

    outer_frame1 = tk.Frame(win, borderwidth=1, relief="solid")

    outer_frame1.place(x=149, y=25, width=117, height=76)

    view_help = tk.Button(win, text = "View help", height = 1, width = 15)

    send_feedback =  tk.Button(win, text = "Send feedback", height = 1, width = 15)

    about_notepad =  tk.Button(win, text = "About Notepad", height = 1, width = 15)

    

    view_help.place(x = 150, y = 25)

    send_feedback.place(x = 150, y = 50)

    about_notepad.place(x = 150, y = 75)

    

help_btn = tk.Button(win, text = "Help", relief = "flat", command = help_func)

help_btn.place(x = 200, y = 0)


replace_option = tk.Button(win , text = "Replace", command = replace_win, relief = "flat")

replace_option.place(x = 255, y =0)

text.place(x = 0, y = 26)


win.mainloop()






Comments

Popular posts from this blog

Amazon

Cyber Security

Xampp tutorial