There are some typos in mdi wrapper of pygnome.
With the attached patch, you will get the better chance to
succeed to use mdi. 
I never used mdi, so can't help you no more.

On Mon, Jan 17, 2000 at 06:59:02PM +0000, Hassan Aurag wrote:
> 
>  Hi,
> 
>  I am working with pygnome 1.0.50
> 
>  Now, for a long time, I have been trying to work with MDI without 
> success.
> 
>  For example, what's wrong with the following:
> 
> 
> 
> #######START CODE
> from gtk import GtkCurve, mainloop
> from gnome.ui import GnomeMDIGenericChild, GnomeMDI
> from _gnomeui import gnome_mdi_generic_child_set_view_creator
> 
> 
> mdi = GnomeMDI('some-app', 'Title')
> 
> def my_create_view(child, whatever=None):
>     return GtkHBox()   # not a toplevel widget
> child = GnomeMDIGenericChild('some-name')
> 
> ##Without the child._o it complains that it needs a gtkobject and not 
> an 
> ##instance. With the object it segfaults
> 
> gnome_mdi_generic_child_set_view_creator(child._o,my_create_view, 1)
> 
> mdi.add_child(child)
> # create a view for the child:
> mdi.create_view(child)
> 
> mainloop()
> 
> 
> ####ENDCODE
> 
>  So can someone out there please write a simple and useless:
> 
> mdi=GnomeMDI(...)
> 
> child=GnomeMDIChild or GenericChild 
> 
> with just one empty GtkHBox in it or any other widget that works.
> 
> By working, I mean:
> 
> a MDI.py file that works with python MDI.py
--- pygnome/gnome/ui.py.orig    Fri Oct  1 17:05:02 1999
+++ pygnome/gnome/ui.py Tue Jan 18 11:32:38 2000
@@ -1107,13 +1107,13 @@
                return _gnomeui.gnome_mdi_remove_child(self._o, child._o,force)
        def remove_all(self, force):
                return _gnomeui.gnome_mdi_remove_all(self._o, force)
-       def open_toplvel(self):
+       def open_toplevel(self):
                _gnomeui.gnome_mdi_open_toplevel(self._o)
        def update_child(self, child):
                _gnomeui.gnome_mdi_update_child(self._o, child._o)
        def get_active_window(self):
                return GnomeApp(_obj=
-                               _gnomeui.gnome_mdi_getactive_window(self._o))
+                               _gnomeui.gnome_mdi_get_active_window(self._o))
        def register(self, wid):
                _gnomeui.gnome_mdi_register(self._o, wid._o)
        def unregister(self, wid):
@@ -1167,19 +1167,19 @@
                        return ret
        def set_view_creator(self, func, *args):
                mfunc = self.__marshal(func).__call__
-               _gnomeui.gnome_mdi_generic_child_set_view_creator(self, mfunc,
+               _gnomeui.gnome_mdi_generic_child_set_view_creator(self._o, mfunc,
                                                                  args)
        def set_menu_creator(self, func, *args):
                mfunc = self.__marshal(func).__call__
-               _gnomeui.gnome_mdi_generic_child_set_menu_creator(self, mfunc,
+               _gnomeui.gnome_mdi_generic_child_set_menu_creator(self._o, mfunc,
                                                                  args)
        def set_config_func(self, func, *args):
                mfunc = self.__marshal(func).__call__
-               _gnomeui.gnome_mdi_generic_child_set_config_func(self, mfunc,
+               _gnomeui.gnome_mdi_generic_child_set_config_func(self._o, mfunc,
                                                                 args)
        def set_label_func(self, func, *args):
                mfunc = self.__marshal(func).__call__
-               _gnomeui.gnome_mdi_generic_child_set_label_func(self, mfunc,
+               _gnomeui.gnome_mdi_generic_child_set_label_func(self._o, mfunc,
                                                                args)
 _gtk._name2cls['GnomeMDIGenericChild'] = GnomeMDIGenericChild
 
--- pygnome/gnomeuimodule.c.orig        Tue Aug  3 22:34:07 1999
+++ pygnome/gnomeuimodule.c     Tue Jan 18 10:43:50 2000
@@ -928,7 +928,7 @@
     PyTuple_SetItem(tmp, 1, data);
     func = tmp;
   }
-  gnome_mdi_generic_child_set_view_creator_full(GNOME_MDI_GENERIC_CHILD(mdi),
+  
+gnome_mdi_generic_child_set_view_creator_full(GNOME_MDI_GENERIC_CHILD(PyGtk_Get(mdi)),
                                                NULL,
                                                PyGtk_CallbackMarshal,
                                                func,

Reply via email to