Skip to content

Enhanced Shopping List Display by Adding Treeview Columns#15

Open
prathamesh901 wants to merge 1 commit intoCSI-DMCE-2024:mainfrom
prathamesh901:add-treeview-shopping-list
Open

Enhanced Shopping List Display by Adding Treeview Columns#15
prathamesh901 wants to merge 1 commit intoCSI-DMCE-2024:mainfrom
prathamesh901:add-treeview-shopping-list

Conversation

@prathamesh901
Copy link
Copy Markdown

Overview: This pull request introduces an improvement to the shopping list application by replacing the Listbox with a Treeview widget. The Treeview provides a more structured way to display the shopping list, showing each item and its corresponding amount in separate columns.

Changes Made:

image
Previously, the shopping list was displayed using a Listbox, where the item and amount were concatenated into a single string and displayed on a single line.
Now, I have replaced the Listbox with a Treeview widget from ttk that supports multiple columns, making it easier to manage and display the shopping list.
The Treeview has two columns:
Item: Displays the name of the item.
Amount: Displays the quantity of the item.

Updated the display_list function:
The display_list function was updated to clear the Treeview widget before inserting the latest items from the shopping_list dictionary.
Each item and its corresponding amount are now displayed in separate columns.

Enhanced UI Layout:
The layout has been adjusted to accommodate the Treeview widget. This enhances the readability of the shopping list by aligning the items and amounts in a structured manner.
I added headers for the columns ("Item" and "Amount") to make it clear what each value represents.

Maintained Existing Functionality:
The core functionalities for adding, removing, and calculating the total items in the shopping list remain unchanged.
Users can still add items with a quantity, remove items, and calculate the total number of items in the list, with the only change being the enhanced visual representation.

Why this change?

  • The previous implementation using a Listbox made it difficult to clearly separate and manage items and amounts.
  • With this change, the shopping list display is more structured, making it easier for users to view and manage their shopping list items.
  • The use of Treeview also opens up possibilities for future enhancements, such as sorting or filtering the shopping list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant