wxPython and wx.Python

Hi,

I'm attempting to learn wxPython using the new namespace. (wx) I search the API documentation and try to use it. (I've downloaded the latest documentation) and when I try to use it, I get errors on undefined global names, functions etc.

For intance. I call...

        dlg = wx.MessageDialog(self, "test application\n", "Testing", wxOK)

I get an error claiming that wxOK not defined yet the documentation shows that it is. If I take the wxOK out then it gives me the dialog with an "ok" and a "Cancel" button and that isn't what I'm looking for. Althought the documentation shows it as wxMessageDialog() instead of wx.MessageDialog() (without the period) My question is this. Is there any API documentation that supports the new namespace? (if that is in fact what my problem is here)

Any help would be fantastic.

Thank,
Dave

Junk wrote:

My question is this. Is there
any API documentation that supports the new namespace? (if that is in fact what my problem is here)

yes, that's the problem. you want wx.OK

The Python-specific docs are coming. In the meantime, wherever you see:

wxWhatever

type

wx.Whatever

The only exception I know of is the Event constants, which are still:

wxEVT_BUTTON

to distinguish them from the binding functions:

wx.EVT_BUTTON(....)

but I don't think I've ever needed the event constants

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Junk wrote:

Hi,

I'm attempting to learn wxPython using the new namespace. (wx) I search the API documentation and try to use it. (I've downloaded the latest documentation) and when I try to use it, I get errors on undefined global names, functions etc.
For intance. I call...

       dlg = wx.MessageDialog(self, "test application\n", "Testing", wxOK)

I get an error claiming that wxOK not defined yet the documentation shows that it is. If I take the wxOK out then it gives me the dialog with an "ok" and a "Cancel" button and that isn't what I'm looking for. Althought the documentation shows it as wxMessageDialog() instead of wx.MessageDialog() (without the period) My question is this. Is there any API documentation that supports the new namespace? (if that is in fact what my problem is here)

Any help would be fantastic.

For almost every 'wx' you see in the docs, replace it with 'wx.' and you'll do fine.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!