質問

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')?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top