Enhanced Shopping List Display by Adding Treeview Columns#15
Open
prathamesh901 wants to merge 1 commit intoCSI-DMCE-2024:mainfrom
Open
Enhanced Shopping List Display by Adding Treeview Columns#15prathamesh901 wants to merge 1 commit intoCSI-DMCE-2024:mainfrom
prathamesh901 wants to merge 1 commit intoCSI-DMCE-2024:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview: This pull request introduces an improvement to the shopping list application by replacing the
Listboxwith aTreeviewwidget. TheTreeviewprovides a more structured way to display the shopping list, showing each item and its corresponding amount in separate columns.Changes Made:
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
Listboxwith aTreeviewwidget fromttkthat 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_listfunction:The
display_listfunction was updated to clear theTreeviewwidget before inserting the latest items from theshopping_listdictionary.Each item and its corresponding amount are now displayed in separate columns.
Enhanced UI Layout:
The layout has been adjusted to accommodate the
Treeviewwidget. 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?
Listboxmade it difficult to clearly separate and manage items and amounts.Treeviewalso opens up possibilities for future enhancements, such as sorting or filtering the shopping list.