Skip to content
Related Articles

Related Articles

Improve Article
Python EasyGUI – Continue Cancel Box
  • Last Updated : 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 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




# 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 :


 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :