Python EasyGUI – Continue Cancel Box

05 Sep, 2020
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 is 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
# importing easygui modulefrom easygui import *  # message / information to be displayed on the screenmessage = "You want to learn more about EasyGUI ?"  # title of the windowtitle = "GfG - EasyGUI"  # creating a continue cancel boxoutput = ccbox(message, title)  # if user pressed continueif output:          # message / information to be displayed on the screen    message = "Go to GeeksforGeeks to learn more about EasyGUI"       # title of the window    title = "GfG - EasyGUI"       # creating a message box    msg = msgbox(message, title)  # if user pressed cancelelse:          # message / information to be displayed on the screen    message = "Ok No Problem"       # title of the window    title = "GfG - EasyGUI"       # creating a message box    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
# importing easygui modulefrom easygui import *  # message / information to be displayed on the screenmessage = "You want to learn more about EasyGUI ?"  # title of the windowtitle = "GfG - EasyGUI"  # button nameschoices = ["Let's Go", "End This !"]  # creating a continue cancel boxoutput = ccbox(message, title, choices)  # if user pressed continueif output:          # message / information to be displayed on the screen    message = "Go to GeeksforGeeks to learn more about EasyGUI"       # title of the window    title = "GfG - EasyGUI"       # creating a message box    msg = msgbox(message, title)  # if user pressed cancelelse:          # message / information to be displayed on the screen    message = "Ok No Problem"       # title of the window    title = "GfG - EasyGUI"       # creating a message box    msg = msgbox(message, title)
Output :
Python-EasyGUI
Python-gui
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Python Classes and Objects
Python OOPs Concepts
Introduction To PYTHON
How to drop one or multiple columns in Pandas Dataframe
Python | os.path.join() method
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
Python | Get unique values from a list
Create a directory in Python