[pygtk] Speaking of libglade...

Ralph Walden rwalden@tripos.com
Wed, 06 Feb 2002 13:00:11 -0600


I seem to be having some trouble with libglade
for glade files larger than about 230K.  libglade
cannot seem to find widget names for widgets near
the end of a file this big.  If I chop the end off
the file and put it in a new file (fun with vi),
then things work o.k. from the new file.

What could I be doing wrong?

I'm using gtk 1.2.9, python 2.1, pygtk 0.6.8, libglade 0.16.

Thanks for any help,


Ralph Walden


Mitch Chapman wrote:
> 
> Alexandre Fayolle wrote:
> >
> > I'm certainly not the first one to encounter the problem. I have an
> > application with a gtk gui built using libglade.
> >
> > Right now, the glade file is in the same directory as the python file, and
> > this works as long as I launch the python script from that directory. I
> > would like to make things a bit more less 'hardcoded'. I've come up with
> > the following hack. Let's say the python module is called
> > my_application.py, and the glade file is my_application.glade. In the
> > module I have:
> >
> > import my_application # import oneself
> > import os.path
> > GLADE_FILE = os.path.join(os.path.dirname(my_application.__file__),
> >                           'my_application.glade')
> >
> > It does the job, but I'm not sure that this ios the right way of doing
> > things. Any comments ?
> 
> Please have a look at PathFinder.py
> ( http://www.linuxjournal.com/modules.php?op=modload&name=NS-lj-issues/issue87&file=4702l2 )
> and the accompanying article about GladeBase, a high-level wrapper
> over libglade:
> ( http://www.linuxjournal.com/article.php?sid=4702 )
> 
> PathFinder enables you to store files, e.g. Glade design files,
> in the same directories as your Python modules, and then to find
> them by specifying their paths relative to the Python path.  So
> your example could be written so:
> 
>         import PathFinder
> 
>         GLADE_FILE = PathFinder.find('my_application.glade')
> 
> GladeBase offers several other features.  For instance it
> lets you write Controller classes whose Gtk+ signal handlers are
> automatically identified and connected at runtime.  It also includes
> a stub generator which can read a Glade design file and generate a
> Controller class complete with signal handler stubs for all signals
> defined in the design file.
> 
> The article includes all of the source code for GladeBase.
> I'm still trying to set up a more permanent home for GladeBase,
> hence the pointers to the article.
> 
> --
> Mitch
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk

-- 

Ralph E. Walden
Tripos, Inc.
rwalden@tripos.com