> There is a file for wx, and another for visio,
> they aren't joined together.
> wx is filled up based on the functionnames of the other.

Aha! This is the missing bit of info.

In that case using getattr makes sense.
The example you gave earlier showed you using getattr on
the local file and seemed to suggest to me that was what
was causing your problem - I just couldn't think why
you'd want to do that!

    def FillUpMenu(self):
        MenuItems = [item for item in dir(visio) if
item.startswith('OnMenu')]
        for FunctionName in MenuItems:

You should probably make sure that the names are all
callable too. Otherwise, if there is a variable called
OnXXX then you will assign it to a menu item and
it will break!

> Every function in the visio module starting with 'OnMenu'
> will be appeared in the application menu.

The way you have written it everything in the dir() result
starting OnXXX will be in the menu - they may not all be
functions!

HTH,

Alan G. 



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to