|
|
Choosing A Webhost: |
Re: PerlGTK with GTK module written in C ?: msg#00130gnome.gtk+.perl
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).)
-- 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> |
|---|---|---|
| Previous by Date: | Re: Unable to locate module error., muppet |
|---|---|
| Next by Date: | Re: PerlGTK with GTK module written in C ?, dams |
| Previous by Thread: | Re: PerlGTK with GTK module written in C ?, Nagappan |
| Next by Thread: | Re: PerlGTK with GTK module written in C ?, dams |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |