Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

More on pack, pack_forget, grid, grid_forget, and grid_remove: You can call pack_forget to remove a widget (if you use pack to add it to the

image text in transcribed

image text in transcribed

More on pack, pack_forget, grid, grid_forget, and grid_remove: You can call pack_forget to remove a widget (if you use pack to add it to the window). Example: import tkinter as tk root - tk.Tk() b = tk.Button(root, text="Delete me", command-lambda: b.pack_forget()) b.pack() root.mainloop() If you use pack_forget, you can later show the widget again calling pack again. If you want to permanently delete it, call destroy on the widget (then you won't be able to re-add it). If you use the grid method, you can use grid_forget or grid_remove to hide the widget. Problem (60 points): Learn about the fundamentals of tkinter widgets and GUI app 1. Create a Python project in Eclipse with a name like FirstName-LastName-exi (e.g., Jane- Doe-ex1). 2. Add five packages to the src folder of the project, as well as an ordinary folder named raw to the src folder of the project. Details follow. Sve ose Editor image Viewer Video Player Editor image View Audio Player Video Player The "Textpad" editor along with the "Save The "Textpad' editor and the "Save and and "Close" buttons appear in the root "Close" buttons disappear from the root window after clicking the "Editor" button window after clicking the "Close" button Figure 1 a. First package named texteditor - This package has a module named editor.py for creating a simple text editor. Use tkinter.scrolledtext module for the editor. The editor must support saving the content of the editor as a text file. It must be saved as a text file in the raw folder. The editor must also support closing the editor, not the root window, including the two buttons. See the Figure 1 above. Note: Although no shown, adding another button named Quit to the root window would be great in addition to the four buttons (i.e., Editor, Image Viewer, Audio Player, and Video Player). b. Second package named imageviewer - This package has a module named image_viewer.py to allow the user to view an image stored in the raw folder. Like the editor, the image_viewer must have two buttons: View and Close. Clicking the view button shows an image stored in the raw folder. Clicking the Close button removes the viewer and the two buttons from the root window. C. Third package named audioplayer - This package has a module named audio_player.py to allow the user to play an audio clip stored in the raw folder. Like the image_viewer, the audio_player must have five buttons: Start, Pause, Resume, Stop, and Close. Clicking the Start button shows an audio clip stored in the raw folder, and so on. Clicking the Close button removes the palyer and the two buttons from the root window. d. Fourth package named videoplayer - This package has a module named video_player.py to allow the user to play a video clip stored in the raw folder. Like the audio_player, the video_player must have two buttons: Play and Close. Clicking the Play button shows an audio clip stored in the raw folder. Clicking the Close button removes the palyer and the two buttons from the root window. e. Fifth package named omniapp - This package has a module named launcher.py to provide an interface to the application with four buttons. See the image below. As you know, the launcher module should import all the modules you have created. Aforementioned, adding another button named Quit to the root window would be great. Editor Image Viewer Audio Player Video Player 3. Test your app before submission. a. Export your project to a zip file (See the Canvas course site for how-to-export). b. Create a test project in Eclipse and import the zip file to the project (See the Canvas course site for how-to-import). C. Run your app to see if it runs flawlessly. 4. Submit the zip file on Canvas. More on pack, pack_forget, grid, grid_forget, and grid_remove: You can call pack_forget to remove a widget (if you use pack to add it to the window). Example: import tkinter as tk root - tk.Tk() b = tk.Button(root, text="Delete me", command-lambda: b.pack_forget()) b.pack() root.mainloop() If you use pack_forget, you can later show the widget again calling pack again. If you want to permanently delete it, call destroy on the widget (then you won't be able to re-add it). If you use the grid method, you can use grid_forget or grid_remove to hide the widget. Problem (60 points): Learn about the fundamentals of tkinter widgets and GUI app 1. Create a Python project in Eclipse with a name like FirstName-LastName-exi (e.g., Jane- Doe-ex1). 2. Add five packages to the src folder of the project, as well as an ordinary folder named raw to the src folder of the project. Details follow. Sve ose Editor image Viewer Video Player Editor image View Audio Player Video Player The "Textpad" editor along with the "Save The "Textpad' editor and the "Save and and "Close" buttons appear in the root "Close" buttons disappear from the root window after clicking the "Editor" button window after clicking the "Close" button Figure 1 a. First package named texteditor - This package has a module named editor.py for creating a simple text editor. Use tkinter.scrolledtext module for the editor. The editor must support saving the content of the editor as a text file. It must be saved as a text file in the raw folder. The editor must also support closing the editor, not the root window, including the two buttons. See the Figure 1 above. Note: Although no shown, adding another button named Quit to the root window would be great in addition to the four buttons (i.e., Editor, Image Viewer, Audio Player, and Video Player). b. Second package named imageviewer - This package has a module named image_viewer.py to allow the user to view an image stored in the raw folder. Like the editor, the image_viewer must have two buttons: View and Close. Clicking the view button shows an image stored in the raw folder. Clicking the Close button removes the viewer and the two buttons from the root window. C. Third package named audioplayer - This package has a module named audio_player.py to allow the user to play an audio clip stored in the raw folder. Like the image_viewer, the audio_player must have five buttons: Start, Pause, Resume, Stop, and Close. Clicking the Start button shows an audio clip stored in the raw folder, and so on. Clicking the Close button removes the palyer and the two buttons from the root window. d. Fourth package named videoplayer - This package has a module named video_player.py to allow the user to play a video clip stored in the raw folder. Like the audio_player, the video_player must have two buttons: Play and Close. Clicking the Play button shows an audio clip stored in the raw folder. Clicking the Close button removes the palyer and the two buttons from the root window. e. Fifth package named omniapp - This package has a module named launcher.py to provide an interface to the application with four buttons. See the image below. As you know, the launcher module should import all the modules you have created. Aforementioned, adding another button named Quit to the root window would be great. Editor Image Viewer Audio Player Video Player 3. Test your app before submission. a. Export your project to a zip file (See the Canvas course site for how-to-export). b. Create a test project in Eclipse and import the zip file to the project (See the Canvas course site for how-to-import). C. Run your app to see if it runs flawlessly. 4. Submit the zip file on Canvas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Visualization A Practical Introduction

Authors: Kieran Healy

1st Edition

0691181624, 978-0691181622

More Books

Students also viewed these Databases questions