Question

[28] Finish the following code in such a way that there will be a button displayed in the GUI. When th button is clicked a me

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • The first blank must define a button whose command argument is processButton()
  • In <space for pack> we have to pack() the button
  • in <space for main loop> we have to call mainloop() on windows
  • In second blank, we have add a showinfo() method with the message "Welcome"

Answers:

Blank 1: lambda: WidgetDemo.processButton(self)

<space for pack>: button1.pack()

<space for main loop> :  window.mainloop()

Blank 2: showinfo(title="message",message="Welcome")

complete code:
from tkinter import from tkinter import messagebox 1 2 3 4 5 6 class WidgetDemo() : def 8 9 10 init_(self): window = Tk() win

output upon object creation:(And after button is clicked)

Widgets Demo! Click here message Welcome OK

Add a comment
Know the answer?
Add Answer to:
[28] Finish the following code in such a way that there will be a button displayed...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • pyhton language [28] Finish the following code in such a way that there will be a...

    pyhton language [28] Finish the following code in such a way that there will be a button displayed in the GUE When the button is clicked a message box will display "Welcome" from tkinter import from tkinter import messagebox class WidgetDemo(): def _init__(self): window = Tk() window.title("Widgets Demo !") frame1 = Frame(window) frame1.pack() button1 = <space for pack> <space for main loop> def processButton(self): messagebox.

  • du Scholarshi... Ag Day Essay Cont... (22) Hig bb Question 30 10 [28] Finish the following...

    du Scholarshi... Ag Day Essay Cont... (22) Hig bb Question 30 10 [28] Finish the following code in such a way that there will be a button displayed in the GUI. When the button is clicked a message box will display "Welcome" from tkinter import from tkinter import messagebox class WidgetDemo(): def _init_(self): window = Tk0) window.title("Widgets Demo !") frame1 = Frame(window) frame 1.pack() button1 = <space for pack> <space for main loop> def processButton(self): messagebox.

  • " In the workshop exercises you have used Python's Tkinter module to create simple Graphical User Interfaces. The following code is an incomplete Python program relying on Tkinter (with delib...

    " In the workshop exercises you have used Python's Tkinter module to create simple Graphical User Interfaces. The following code is an incomplete Python program relying on Tkinter (with deliberately unhelpful variable and function names) which you must complete by filling in the blanks. When complete the program should create a window with two buttons, labelled and!!', respectively. When the button la belled'???' is pushed nothing happens. When the button labelled'!!"is pushed both buttons' labels are set to'!!!' from tkinter...

  • GUI Programming Creating a Kilometer to Miles Converter Lab Assignment Objectives Understand the basics of tkinter...

    GUI Programming Creating a Kilometer to Miles Converter Lab Assignment Objectives Understand the basics of tkinter GUI development. Based on an informal application specification be able to develop a tkinter GUI program that contains one or more Label widgets. Be able to prompt user for input to a GUI application using a messagebox. Obtain user input into a GUI application that can be used for event driven selection. Be able to develop a tkinter GUI program that supports event-based widgets....

  • Python 3 Fix the code so if the user enter the same bar code more than...

    Python 3 Fix the code so if the user enter the same bar code more than three times, it shows a warning message indicating that the product was already tested 3 times and it reached the limits Code: import tkinter as tk from tkcalendar import DateEntry from openpyxl import load_workbook from tkinter import messagebox from datetime import datetime window = tk.Tk() window.title("daily logs") window.grid_columnconfigure(1,weight=1) window.grid_rowconfigure(1,weight=1) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window,...

  • Python 3 Code does not save the data into excel properly ​​​​​​​ # required library import...

    Python 3 Code does not save the data into excel properly ​​​​​​​ # required library import tkinter as tk from tkcalendar import DateEntry import xlsxwriter # frame window = tk.Tk() window.title("daily logs") #window.resizable(0,0) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window, text="Money Lost").grid(row=2, sticky="W", pady=20, padx=20) tk.Label(window, text="Failed date").grid(row=3, sticky="W", pady=20, padx=20) # entries barcode = tk.Entry(window) product = tk.Entry(window) money = tk.Entry(window) # arraging barcode.grid(row=0, column=1) product.grid(row=1, column=1) money.grid(row=2, column=1) cal =...

  • Python 3 How to change the icon in the error message want to put a yellow...

    Python 3 How to change the icon in the error message want to put a yellow warning icon import tkinter as tk from tkcalendar import DateEntry from openpyxl import load_workbook from tkinter import messagebox window = tk.Tk() window.title("daily logs") window.grid_columnconfigure(1,weight=1) window.grid_rowconfigure(1,weight=1) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window, text="Money Lost").grid(row=2, sticky="W", pady=20, padx=20) tk.Label(window, text="sold by").grid(row=3, sticky="W", pady=20, padx=20) tk.Label(window, text="Failed date").grid(row=4, sticky="W", pady=20, padx=20) # entries barcode = tk.Entry(window) product =...

  • X Programming Exercise 8.6 | Instructions breezypythongui.py taxformwithgui.py + Q Desktop + ve Add radio button...

    X Programming Exercise 8.6 | Instructions breezypythongui.py taxformwithgui.py + Q Desktop + ve Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option's rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single. 1 2 File: taxformwithgui.py 3 Project 8.6 4 A GUI-based tax calculator. 5 6 Computes and prints the total...

  • Python 3 Fix the code so when i click on submit botton the values reset Code:...

    Python 3 Fix the code so when i click on submit botton the values reset Code: import tkinter as tk from tkcalendar import DateEntry from openpyxl import load_workbook from tkinter import messagebox from datetime import datetime window = tk.Tk() window.title("daily logs") window.grid_columnconfigure(1,weight=1) window.grid_rowconfigure(1,weight=1) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window, text="Money Lost").grid(row=2, sticky="W", pady=20, padx=20) tk.Label(window, text="sold by").grid(row=3, sticky="W", pady=20, padx=20) tk.Label(window, text="Working product").grid(row=4, sticky="W", pady=20, padx=20) #Working product label tk.Label(window, text="Failed...

  • Add radio button options for filing status to the tax calculator program of Project 1. The...

    Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option’s rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single. For the calculations from Project 1, I was gonna use this. TAX_RATE = 0.20 STANDARD_DEDUCTION = 10000.0 DEPENDENT_DEDUCTION = 3000.0 # Request the inputs gross Income = float(input("Enter the gross income: "))...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT