ActiveX events in wxPython not working

Cliff Wells logiplexsoftware at earthlink.net
Thu Apr 25 15:26:37 EDT 2002


On 25 Apr 2002 07:25:36 -0700
Perry wrote:

> Hi,
> 
> I'm using wxPython as an ActiveX (GUI) container. The OCX draws a
> gantt
> chart from supplied data. Everything works fine, appart events.
> 
> Here is the code:

[snip]

> class MyGanttPanel(wxPanel):
>   def __init__(self, parent):
>      wxPanel.__init__(self, parent, -1)
> 
>      sizer = wxBoxSizer(wxVERTICAL)
>         
>      GanttClass = MakeActiveXClass(gchart.VcGantt, eventObj=MyEvents)
>      gantt.VcGantt = GanttClass(self, -1, wxPoint(0,0), style=wxMAXIMIZE)
       ^^^^^ Where is this instantiated?

[snip]

I don't see where the object "gantt" is being created.  You can't add an
attribute to a non-existent object:

Python 2.2 (#1, Mar 15 2002, 11:52:42) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f.a = 1 
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'f' is not defined
>>> class foo: pass
... 
>>> f = foo()
>>> f.a = 1
>>> 

Are you running the program from a shell or by double-clicking its icon?  It
may be that there are errors you aren't seeing if you aren't using a shell. 
Other than that, I'm afraid my ActiveX knowledge is (happily) non-existent, so
if this isn't your problem then I'm afraid I can't help much.


-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308





More information about the Python-list mailing list