From 7f3e7b17a6dcfece7216ac9c7e72a2d1c6cc7c83 Mon Sep 17 00:00:00 2001 From: akshayram1 Date: Fri, 4 Oct 2024 22:25:11 +0530 Subject: [PATCH 1/3] Create to-do-list-app-gui --- Mini-Projects/Python/to-do-list-app-gui | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Mini-Projects/Python/to-do-list-app-gui diff --git a/Mini-Projects/Python/to-do-list-app-gui b/Mini-Projects/Python/to-do-list-app-gui new file mode 100644 index 00000000..41bb8cbc --- /dev/null +++ b/Mini-Projects/Python/to-do-list-app-gui @@ -0,0 +1,55 @@ +import tkinter as tk +from tkinter import messagebox + +# Functionality to add tasks +def add_task(): + task = entry_task.get() + if task != "": + listbox_tasks.insert(tk.END, task) + entry_task.delete(0, tk.END) + else: + messagebox.showwarning("Input Error", "Please enter a task.") + +# Functionality to delete selected task +def delete_task(): + try: + task_index = listbox_tasks.curselection()[0] + listbox_tasks.delete(task_index) + except: + messagebox.showwarning("Selection Error", "Please select a task to delete.") + +# Functionality to mark a task as completed +def mark_done(): + try: + task_index = listbox_tasks.curselection()[0] + task = listbox_tasks.get(task_index) + listbox_tasks.delete(task_index) + listbox_tasks.insert(tk.END, task + " (Completed)") + except: + messagebox.showwarning("Selection Error", "Please select a task to mark as completed.") + +# Setting up the main application window +window = tk.Tk() +window.title("To-Do List App") + +# Task entry widget +entry_task = tk.Entry(window, width=35) +entry_task.pack(pady=10) + +# Add task button +button_add_task = tk.Button(window, text="Add Task", width=40, command=add_task) +button_add_task.pack(pady=5) + +# Listbox to display tasks +listbox_tasks = tk.Listbox(window, width=40, height=10) +listbox_tasks.pack(pady=10) + +# Buttons to delete or mark tasks as completed +button_delete_task = tk.Button(window, text="Delete Task", width=40, command=delete_task) +button_delete_task.pack(pady=5) + +button_mark_done = tk.Button(window, text="Mark as Completed", width=40, command=mark_done) +button_mark_done.pack(pady=5) + +# Running the GUI loop +window.mainloop() From 1dc88f0aabb66cb7236ebcda5204a2083afb0bcf Mon Sep 17 00:00:00 2001 From: akshayram1 Date: Fri, 4 Oct 2024 22:31:07 +0530 Subject: [PATCH 2/3] Added to do list app with gui --- .../Python/{to-do-list-app-gui => to-do-list-app-gui,py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Mini-Projects/Python/{to-do-list-app-gui => to-do-list-app-gui,py} (100%) diff --git a/Mini-Projects/Python/to-do-list-app-gui b/Mini-Projects/Python/to-do-list-app-gui,py similarity index 100% rename from Mini-Projects/Python/to-do-list-app-gui rename to Mini-Projects/Python/to-do-list-app-gui,py From 95c937232773a35e4823dc75e212e081129e5501 Mon Sep 17 00:00:00 2001 From: akshayram1 Date: Fri, 4 Oct 2024 22:32:03 +0530 Subject: [PATCH 3/3] Added to do list app with gui --- .../Python/{to-do-list-app-gui,py => to-do-list-app-gui.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Mini-Projects/Python/{to-do-list-app-gui,py => to-do-list-app-gui.py} (100%) diff --git a/Mini-Projects/Python/to-do-list-app-gui,py b/Mini-Projects/Python/to-do-list-app-gui.py similarity index 100% rename from Mini-Projects/Python/to-do-list-app-gui,py rename to Mini-Projects/Python/to-do-list-app-gui.py