ActiveX events in wxPython not working

Perry perry at subdimension.com
Fri Apr 26 05:09:15 EDT 2002


Cliff Wells <logiplexsoftware at earthlink.net> wrote in message news:<mailman.1019763678.16478.python-list at python.org>...
> 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.


gantt is a global class created like this:

class gantt:
  VcGantt = None
  status = "somestring"
  start = startDate
  end = endDate
  ...

This class holds all the data needed by the program.
So the class gantt exists outside the class MyGanttPanel, I'm using it
in other classes to feed the data to the Gantt
(gantt.VcGantt.InsertNode).
So the object is not destroyed.
I have searched this news group for similar problems and found a
similar
post, the code was almost the same. Somebody suggested to downgrade
win32com
to the prior version and it seemed it worked, but this was at win32com
version around 120.

Thanks for all the replies.



More information about the Python-list mailing list