Open In App
Related Articles

Python EasyGUI – Continue Cancel Box

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

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

# importing easygui module
from easygui import *
 
# message / information to be displayed on the screen
message = "You want to learn more about EasyGUI ?"
 
# title of the window
title = "GfG - EasyGUI"
 
# creating a continue cancel box
output = ccbox(message, title)
 
# if user pressed continue
if 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 cancel
else:
     
    # 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 

Python3

# importing easygui module
from easygui import *
 
# message / information to be displayed on the screen
message = "You want to learn more about EasyGUI ?"
 
# title of the window
title = "GfG - EasyGUI"
 
# button names
choices = ["Let's Go", "End This !"]
 
# creating a continue cancel box
output = ccbox(message, title, choices)
 
# if user pressed continue
if 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 cancel
else:
     
    # 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 :



Last Updated : 10 Apr, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads