Author: bugman Date: Mon Jul 25 21:12:46 2011 New Revision: 13868 URL: http://svn.gna.org/viewcvs/relax?rev=13868&view=rev Log: Updates to the question() function for showing a question dialog. The dialog can now have a title. Modified: branches/gui_testing/gui/message.py Modified: branches/gui_testing/gui/message.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/message.py?rev=13868&r1=13867&r2=13868&view=diff ============================================================================== --- branches/gui_testing/gui/message.py (original) +++ branches/gui_testing/gui/message.py Mon Jul 25 21:12:46 2011 @@ -94,9 +94,13 @@ sys.stderr.write("Missing data: %s\n" % msg) -def question(msg, default=False): +def question(msg, caption='', default=False): """A generic question box. + @param msg: The text message to display. + @type msg: str + @keyword caption: The window title. + @type caption: str @keyword default: If True, the default button will be 'yes', otherwise it will be 'no'. @type default: bool @return: The answer. @@ -110,8 +114,9 @@ style = wx.NO_DEFAULT # The dialog window. - dialog = wx.MessageDialog(None, message = msg, style = wx.YES_NO | style) + dialog = wx.MessageDialog(None, message=msg, caption=caption, style=wx.YES_NO|style) + # The answer. answer = False if dialog.ShowModal() == wx.ID_YES: answer = True