Create an Python program using tkinter that does the following: 1) Create a main window widget...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create an Python program using tkinter that does the following: 1) Create a main window widget 2) Create three frame widgets 3) Put a label in each frame - use your own text 4) Put a button widget in each of the top two frames. Create a message box for each button. It is your choice what the message will say. Use your own text. 5) In the third frame, add a Quit button I want to see several descriptive comments throughout the code. Name the program Assignl-LastFirstInit where Last is your last name and FirstInit is your first initial. For example: Assign1-LilaQ. At the top of the program add three lines of comments - Your name, the date, and the assignment number. # This program has a Quit button that calls # the Tk class's destroy method when clicked. import tkinter import tkinter.messagebox class MyGUI: def __init__(self): # Create the main window widget. self.main_window = tkinter.Tk() # Create a Button widget. The text 'Click Me!' # should appear on the face of the Button. The #do_something method should be executed when # the user clicks the Button. self.my_button = tkinter.Button(self.main_window, text='Click Me!', command=self.do_something) # Create a Quit button. When this button is clicked # the root widget's destroy method is called. # (The main_window variable references the root widget, # so the callback function is self.main_window.destroy.) self.quit_button = tkinter.Button(self.main_window, text='Quit', command=self.main_window.destroy) # Pack the Buttons. self.my_button.pack() self.quit_button.pack() # Enter the tkinter main loop. tkinter.mainloop() # The do_something method is a callback function # for the Button widget. def do something(self): # Display an info dialog box. tkinter.messagebox.showinfo('Response', 'Thanks for clicking the button.') # Create an instance of the MyGUI class. my_gui = MyGUI() Create an Python program using tkinter that does the following: 1) Create a main window widget 2) Create three frame widgets 3) Put a label in each frame - use your own text 4) Put a button widget in each of the top two frames. Create a message box for each button. It is your choice what the message will say. Use your own text. 5) In the third frame, add a Quit button I want to see several descriptive comments throughout the code. Name the program Assignl-LastFirstInit where Last is your last name and FirstInit is your first initial. For example: Assign1-LilaQ. At the top of the program add three lines of comments - Your name, the date, and the assignment number. # This program has a Quit button that calls # the Tk class's destroy method when clicked. import tkinter import tkinter.messagebox class MyGUI: def __init__(self): # Create the main window widget. self.main_window = tkinter.Tk() # Create a Button widget. The text 'Click Me!' # should appear on the face of the Button. The #do_something method should be executed when # the user clicks the Button. self.my_button = tkinter.Button(self.main_window, text='Click Me!', command=self.do_something) # Create a Quit button. When this button is clicked # the root widget's destroy method is called. # (The main_window variable references the root widget, # so the callback function is self.main_window.destroy.) self.quit_button = tkinter.Button(self.main_window, text='Quit', command=self.main_window.destroy) # Pack the Buttons. self.my_button.pack() self.quit_button.pack() # Enter the tkinter main loop. tkinter.mainloop() # The do_something method is a callback function # for the Button widget. def do something(self): # Display an info dialog box. tkinter.messagebox.showinfo('Response', 'Thanks for clicking the button.') # Create an instance of the MyGUI class. my_gui = MyGUI()
Expert Answer:
Answer rating: 100% (QA)
It seems like youre trying to create a Python program using Tkinter to create a GUI with frames labe... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Give an example of standardizing arguments.
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
A scholarship recipient may exclude from gross income the scholarship proceeds received for: Tuition, housing, and meals. O Tuition, books, and supplies. O Meals but not housing. O Meals and housing,...
-
Gross Profit Method You are called by Kevin Garnett of Celtic Co. on July 16 and asked to prepare a claim for insurance as a result of a theft that took place the night before. You suggest that an...
-
Thirty patients with a similar medical condition were randomly allocated among six physicians, so that each physician received exactly five patients. The times in minutes taken for the physicians to...
-
A \(15-\mathrm{kg}\) box is pushed at \(5 \mathrm{~m} / \mathrm{s}\) across a low-friction floor and is caught by a \(60-\mathrm{kg}\) man on low-friction skates, initially at rest. What is the...
-
Starbucks is a global company that provides high-quality coffee products. Assume that as part of its expansion strategy, Starbucks plans to open numerous new stores in Mexico in three years. The...
-
Suppose we have a nMOSCAP made of Si. Suppose the channel doping is too strong at p = 1019 cm-3. All plots should assume the metal is on the left side. For this problem, we apply Vgs = Vth. (a) Plot...
-
Mahalo Boat Adventure Inc. has a July 31 year-end. It showed the following partial amortization schedules regarding two bond issues: Required Answer the following for each bond issue: a. Were the...
-
Elaborate The Statements of Income
-
After graduating from college with a degree in marketing, your first job was working in the marketing department for a fast-food chain located in the southwestern part of the United States. After...
-
Although you might think working for an ice cream company would be motivating under almost any circumstances, Graeters doesnt take its employees commitment for granted. Including full-time and...
-
Because a managers job varies from department to department within firms, as well as among firms, it is virtually impossible to write a generic description of a managers job. If you are contemplating...
-
Empowerment makes workers feel more involved in their jobs and the operations of the organization by involving them in decision making. However, empowerment is a tool that is used inconsistently in...
-
Which of the following would best explain an increase in receivables turnover? A . The company adopted new credit policies last year and began offering credit to customers with weak credit histories....
-
please using python to solve it GameStop Function Name: buyStocks() Parameters: currentPrice ( float), finalPrice ( float), growth ( float) Returns: days (int) Description: You are trying to make...
-
Read the following description and Write a response of it. The discretion of public administrators can be decreased, but not altogether eliminated. Officials will use their discretion in any given...
-
Open the Martins Solution.sln file contained in the VB2017\AppC\Martins Solution folder. Use what you learned in the appendix to debug the application.
-
In this exercise, you modify the Proper Case application from Exercise 6. If necessary, complete Exercise 6. Then, use Windows to make a copy of the Proper Case Solution folder. Rename the copy...
-
Open the Average Score Solution.sln file contained in the VB2017\AppC\Average Score Solution folder. Use what you learned in the appendix to debug the application.
-
Management is Ongoing process Social process Integrated process All the above
-
Which of the following approaches is used to study management? Art Process Science Profession
-
Which is the correct order for the process of management? Planning, organizing, staffing, directing, and controlling Planning, organizing, directing, staffing, and controlling Planning,...
Study smarter with the SolutionInn App