LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-01-2008, 12:43 AM   #1
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
C/C++ embedding Lua with Gtk question


I've never worked with Lua before, but I find myself in a situation where I want to embed a scripting language into a C++/gtkmm app. I've read a number of tutorials involving how one passes variables into the embedded lua scripts and vice-versa.

However, what I've read only seems to pertain to primitive types and C style strings. What I want to know is, is there any way to pass around a Gtkmm widget (less likely) or a gtk+ widget (more likely)? Or perhaps I should be asking if they will even interoperate or both insist on running their own main loop?

Anyone done this before?
 
Old 09-01-2008, 06:05 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
There are a number of ways and 3rd party libraries which you use to acheive a C++ and Lua binding.
The simplest is Lunar which is documented on the Lua user wiki.
Swig, although I have seen numerous reports on the mailing list of problems with it when using Lua.
Luaplus, yet this uses a modified version of Lua.
LuaBind uses metaprogramming and Boost to create a binding.
MLuaBind which seeks to do the same as LuaBind yet without the dependency on Boost, instead using the Loki library.
CppLua which I have no real knowledge about.
toLua, which like swig uses a precompilation pass to generate a binding.
SqPlus is a binding which uses a modified Lua called Squirrel which was designed for games by a professional games developer.
CPB which only works with windows using the debug symbols IIRC.
In addition to these I have a binding of my own, yet it is currently broken which multiple inheritance (I really should fix it )
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lua embedding issues eucharn Programming 2 07-16-2008 04:36 PM
Embedding gnuplot x window into GTK Ronnie_Raj Linux - Software 2 07-18-2007 03:43 PM
Embedding Gnuplot x window results into gtk Ronnie_Raj Programming 1 07-18-2007 01:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration