Re: human language support

On Wed, 13 Jun 2001, Jim Edwards wrote:


Ive been lurking here and working with glade/gtk+ for a short while now
and have a couple of questions:

1. Can someone point me to an example of, or document about,  how to
build a gtk+ gui with multi-language support.

2. I have an application in C with no gui and one in perl with a perl/Tk
gui.  I want to combine the two with a gtk+ gui - I have some experience
with perl XS so I have an idea of what Im getting into, but i wonder if
anyone has tried to write callbacks in perl from a gtk+ mostly in C.
It seems like that would be the right place to cross languages, but
maybe some of what glade calls interface calls should also be done from

When writing callbacks in C, or callbacks in general one must remember
that the GUI thread is halted for the duration of the callbacks. If they
are really long, it could create this simplistic window form while the
application thinks.

The best way to handle callbacks is to place their logic on separate
threads. I believe the ActivePerl distribution supports threads, but I'm
not sure if thread support is built to perl by default in all
distribtions. Thus, I'm not sure you can rely on it.

You can have the thread as a standard C pthread and use polling on the GUI
part to query whether it has finished. That should be portable enough. You
could also try some multi-processing games.

Guy Keren, is planning to give a lecture about Multi-threaded GUI
programming with some focus about Gtk+ (in C) for the Haifa Linux Club.
When it is ready, it will be available on the club's homepage:

I suppose there are other documents about multi-threaded GUI design.
(STFE*) I remember that when I worked on Windows, my application crashed
because I called an MFC GUI function from a different thread. Eventually,
I resorted to sending this window a user message and having the callback
call the MFC function. (MFC is not thread-safe and I don't think Gtk+ is

That's just what I can tell you about it, but you must remember that I did
not have too much experience in GUI design. Especially not on UNIX, where
most of the applications I use are command-line ones.

Hope it helps,

        Shlomi Fish

* STFE = Search the F****** Engine. A term coined by Guy Keren himself.



gtk-perl-list mailing list
gtk-perl-list gnome org

Shlomi Fish        shlomif vipe technion ac il 
Home Page:
Home E-mail:       shlomif techie com

A more experienced programmer does not make less bugs. He just realizes
what went wrong more quickly.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]