Python EasyGUI – Continue Cancel Box
Continue Cancel Box : It is used to display a window having a two option continue or cancel in EasyGUI, it can be used where there is a need to display two option continue or cancel for example when we want to confirm the option if continue is pressed application will move forward else it will get terminated, below is how the continue cancel box looks like
In order to do this we will use msgbox method Syntax : ccbox(message, title, choices) Argument : It takes 3 arguments, first string i.e message/information to be displayed, second string i.e title of the window and third is list having exactly two values which is two option for continue and cancel Return : It returns True if continue is pressed else False
Example : In this we will create a continue cancel box, when any button is pressed it will show the specific message on the screen, below is the implementation
Python3
from easygui import *
message = "You want to learn more about EasyGUI ?"
title = "GfG - EasyGUI"
output = ccbox(message, title)
if output:
message = "Go to GeeksforGeeks to learn more about EasyGUI"
title = "GfG - EasyGUI"
msg = msgbox(message, title)
else :
message = "Ok No Problem"
title = "GfG - EasyGUI"
msg = msgbox(message, title)
|
Output :
Another Example : In this we will create a continue cancel box with new text for the cancel and continue button, when any button is pressed it will show the specific message on the screen, below is the implementation
Python3
from easygui import *
message = "You want to learn more about EasyGUI ?"
title = "GfG - EasyGUI"
choices = ["Let's Go", "End This !"]
output = ccbox(message, title, choices)
if output:
message = "Go to GeeksforGeeks to learn more about EasyGUI"
title = "GfG - EasyGUI"
msg = msgbox(message, title)
else :
message = "Ok No Problem"
title = "GfG - EasyGUI"
msg = msgbox(message, title)
|
Output :
Last Updated :
10 Apr, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...