Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: PerlGTK with GTK module written in C ?: msg#00130

gnome.gtk+.perl

Subject: Re: PerlGTK with GTK module written in C ?


On Jul 16, 2004, at 2:26 PM, Nagappan wrote:

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

yes, it is very possible. gaim embeds several languages in its plugins. i dug through the perl manual to figure out the attached example, but gaim has some code which may be illustrative (their perl support predates gtk2-perl, as far as i can tell, and has a mini-binding for the important bits of glib that gaim plugins need):
http://cvs.sourceforge.net/viewcvs.py/gaim/gaim/plugins/perl/perl.c? rev=1.39&view=auto


What do you suggest me.

you will have to embed a perl/python interpreter in your plugins.

this is actually really easy with perl. i figured it out in only a little while (granted i've been doing a lot of perlxs so i had an idea of i was doing) from the excellent tutorial in the perlembed manpage. the stuff i don't know really at all is the gtk module stuff.

attached is a simple example of how you'd do it. i don't know how to tell gtk to load modules that aren't in the system gtk+ modules dir (e.g. /usr/lib/gtk-2.0/modules/) so you'll have to have root access to try it out (unless you installed gtk+ to a sandbox ;-). the example uses a perl interpreter to load Gtk2 and create a new dialog 1 second after the app starts, without any changes to the app at all. i didn't try to figure out how to communicate between the module and the app; that's your job. :-)

i imagine that python would be very similar.

(by the way, you don't have to use the module with the included foo program, it also works with any gtk+ program (it was pretty cool to see it pop up over the gimp).)

Attachment: embed.tar.gz
Description: GNU Zip compressed data



--
That's it! It's one thing for a ghost to scare my children, but it's another to play my theremin!
- Homer Simpson
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe