Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox??
Asked
Active
Viewed 1,582 times
1 Answers
0
By 'activate', do you mean make it so the user can close the message box by clicking the close ('X') button?
I do not think it is possible using tkMessageBox
. I guess your best bet is to implement a dialog box with this functionality yourself.
BTW: What should askquestion()
return when the user closes the dialog box?

codeape
- 97,830
- 24
- 159
- 188
-
i dont need a retun type when it closes... when i push "yes" it returns yes.Similarly for "No" – user46646 Jul 20 '09 at 05:59
-
So you want it to return None on close. AFAIK, it cannot be done with tkMessageBox. Implement your own dialog box class/functions. See http://effbot.org/tkinterbook/tkinter-dialog-windows.htm . The tkSimpleDialog module is part of the standard python distro. Inherit that, see the example under 'Creating a simple dialog, revisited', where the apply() method sets a return value. – codeape Jul 20 '09 at 06:06
-
How to write text on a frame while creating dialog boxes using Tkinter ? – user46646 Jul 20 '09 at 06:39
-
I suggest you add a label widget to the dialog box. – codeape Jul 20 '09 at 08:46