Moving on, I found an example of a wx.MessageDialog to be called from the
Help->About menu. However, it does not compile and my reading of the
wxWidgets class description does not help me to translate from the C++ to
python. I'd appreciate a point to what is wrong. Here's the code:
SPE indicates an error with the dlg.ShowModal() line when I save the file;
if I comment out that line, the error is on the dlg.Destroy() line. The
problem is invalid syntax with the 'dlg'; therefore, I assume that the model
I used as an example is incorrect.
How should I call for the display and destruction of wx.MessageDialog()s in
the future?
Thanks,
Rich
···
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Moving on, I found an example of a wx.MessageDialog to be
called from the
Help->About menu. However, it does not compile and my reading of the
wxWidgets class description does not help me to translate
from the C++ to python. I'd appreciate a point to what is
wrong. Here's the code:
SPE indicates an error with the dlg.ShowModal() line when
I save the file; if I comment out that line, the error is on
the dlg.Destroy() line. The problem is invalid syntax with
the 'dlg'; therefore, I assume that the model I used as an
example is incorrect.
How should I call for the display and destruction of
wx.MessageDialog()s in the future?
It's a problem in how you build your multi-line string. Also, your Styles
weren't specified quite right. Try:
It's a problem in how you build your multi-line string.
David,
Sigh. I should have seen this. Thanks.
Also, your Styles weren't specified quite right.
I wondered if they, too, needed a period. Now I know.
There are a couple of other ways to handle a long string like that, but this
should work.
I considered three quotes and no newlines. Didn't know if it mattered with
a message dialog box.
Many thanks,
Rich
···
On Mon, 22 Aug 2005, David Woods wrote:
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
It's a problem in how you build your multi-line string.
Sigh. I should have seen this. Thanks.
Well, I tried both adding a backslash continuation symbol and triple quotes
...
Also, your Styles weren't specified quite right.
... and I fixed the syntax here. Still the same "invalid syntax" error at
the same point. So there's something else I'm still missing.
Thanks again,
Rich
···
On Mon, 22 Aug 2005, Rich Shepard wrote:
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Almost got it. The call needs to be wx.MessageDialog.ShowModal(), not
wx.MessageDialog() ... or somthing like that. Here's the latest error
message:
Traceback (most recent call last):
File "scMain.py", line 691, in OnAbout
impact assessments""", wx.OK | wx.ICON_INFORMATION)
TypeError: unbound method ShowModal() must be called with MessageDialog
instance as first argument (got MyFrame instance instead)
I'm still not understanding the syntax despite reading the wxPython class
descriptions.
Rich
···
On Mon, 22 Aug 2005, Rich Shepard wrote:
Well, I tried both adding a backslash continuation symbol and triple quotes
... and I fixed the syntax here. Still the same "invalid syntax" error at
the same point. So there's something else I'm still missing.
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
OK. Got it this time. Again it was missing parameters passed to the method.
When I added the identifiers, "message = " and "style = " it worked. It was
the missing caption that blew it up. Is the caption something displayed on
the window frame as a title?
Thanks for the help, David.
Rich
···
On Mon, 22 Aug 2005, Rich Shepard wrote:
Almost got it. The call needs to be wx.MessageDialog.ShowModal(), not
wx.MessageDialog() ... or somthing like that. Here's the latest error
message:
I'm still not understanding the syntax despite reading the wxPython class
descriptions.
--
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
> Almost got it. The call needs to be
wx.MessageDialog.ShowModal(), not
> wx.MessageDialog() ... or somthing like that. Here's the
latest error
> message:
>
> I'm still not understanding the syntax despite reading the
wxPython
> class descriptions.
OK. Got it this time. Again it was missing parameters
passed to the method. When I added the identifiers, "message
= " and "style = " it worked. It was the missing caption that
blew it up. Is the caption something displayed on the window
frame as a title?
Thanks for the help, David.
Sorry I wasn't clearer, in that I did also add a "style=" qualifier. Yes,
the "caption" parameter is optional text that appears in the title bar.