You can use Buttonbox () to define your own set of buttons, and Buttonbox () displays a set of buttons that you have defined. īuttonbox (msg= ", title=", choices= (' Button1 ', ' Button2 ', ' Button3 '), Image=none, Root=none) To be honest, this function is exactly the same as the Ccbox () function. Importimport Easygui as Gif g.ccbox (" Dear still play ?" ", choices= (" also want to play!) "," Forget It/(ㄒoㄒ)/~~")): g.msgbox (" still don't play, go to sleep! "Else: sys.exit (0) Note that Ccbox () is a return integer of 1 or 0, not a Boolean type of True or False. ![]() #The title defaults to an empty string, and the information is unobstructed with a simple default value#For example, the parameters of the MsgBox () function title section are optional, so you can specify a message parameter when you call MsgBox, for example:msg = G.msgbox ("Hello Easy GUI")#of course, you can also specify information parameters and caption Parameterstitle = G.msgbox (msg="I must learn to program! ", title="Title Section", ok_button="come on")Ĭcbox (msg= ' shall I continue? ', title= ', choices= (' Continue ', ' Cancel '), Image=none)Ĭcbox () provides a choice: Continue or Cancel, and returns 1 (checked Continue) or 0 (check cancel) accordingly. #! /usr/bin/env python#-*-coding:utf-8-*-#_author_ = "Ma Qing"#_date_ = "1"#_desc_ = A small window of the simplest Java-like MessageBoxImportEasygui as G#for most of the Easygui functions there are default parameters, and almost all components display a message and a caption. ![]() The following is an instance function of MsgBox (): MsgBox () displays a message and provides an "OK" button, you can specify any message and caption, and you can even rewrite the contents of the "OK" button. MsgBox (msg= ' (Your message goes here) ', title= ', ok_button= ' OK ', Image=none, Root=none)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |