I've been trying to get tkmessagebox.askquestion to ask a question where there are more answers than 'yes' and 'no.' I know that askquestion returns a string 'yes' when yes is clicked, and I'm trying to add more buttons to that dialogue box. Can this even be done with tkmessagebox? How could I add more button options (i.e., 'pass' and 'abstain' in addition to 'yes' and 'no')?
Asked
Active
Viewed 1,161 times
2
-
Have you managed this? If so, can you please post the relevant code? – AlwaysLearning Jun 01 '17 at 13:51
1 Answers
2
No, it is not possible with tkMessageBox.
The type option of the Dialog class (used by tkMessageBox) only allows the values abortretryignore
, ok
, okcancel
, retrycancel
, yesno
, and yesnocancel
. You can use these with your Dialog subclasses, but if you want to show more buttons I recommend you to use a Toplevel widget and add them to the window or define your own class.

A. Rodas
- 20,171
- 8
- 62
- 72