Re: PerlGTK with GTK module written in C ?



Hi Muppet,
    Nice. Thanks for spending some time for my query :)

Is there a way in which I can integrate at-least Perl / Python. Then that will be of great.

What do you suggest me.

Thanks
Nagappan

On Fri, 2004-07-16 at 08:46 -0400, muppet wrote:
upon rereading this, after having read the other, longer message you
sent later, i am beginning to understand what you're trying to do...

On Mon, 2004-07-12 at 23:14, Nagappan wrote:
> I have written a GTK module in C (gtk_module_init). [...]
> What I thought is, why
> can't we integrate the different languages like Python, Perl, Java into
> our module (Which I have already written it). So that people who knows
> Python / Perl / Java can write an external plug-in. Which will be called
> at run-time. This may be integrated by using signals (This is only my
> assumption).

so you're wanting a gtk module (a chunk of code which can be loaded
dynamically by gtk+ itself) which is implemented in something other than
C.

so, for example, you could have a python program which loads pygtk and
triggers the loading of a gtkmodule written in perl.

this is possible, but rather involved.  you'll have to have C code to
implement the entry points of the gtk module for gtk+ to call, and the
main entry point gtk_module_init() will have to start a new embedded
interpreter (perl, python, jvm, etc -- C++ is a special case that
doesn't need all of this) which will then execute the correct code on
callbacks and such.  this module code should register callbacks for
signals, and all that *should* Just Work, but the devil is in the
details.  note that the perl/python/scheme/java interpreter won't be
running all the time, only when explicitly invoked (i have never used
gtk2-perl in this way, but i believe this is how the gimp uses scheme).

does that make sense?


--
Nagappan <anagappan novell com>
Novell Software Development (I) Ltd


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