Re: Octave bindings for GTK+




On Jul 16, 2004, at 3:25 PM, Muthiah Annamalai wrote:

However it has severe limitation of not being able to integrate a GUI framework for Octave, and remains tied down to the simple Text UI.

This would be really useful. I've seen people do amazing things with matlab's hackish and ugly gui tools, hooking a nice widget set up to octave would be a definite plus for it over matlab.


Im in looking forward to positively write a {GTK+ [or] GTK#} binding for Octave. Please help me by suggesting the steps in doing so. All useful pointers, code and samples are welcome.

James Henstridge (of PyGTK and libglade) once wrote an excellent tutorial on writing language bindings for gtk+/gnome. http://anoncvs.gnome.gr.jp/viewcvs.cgi/language-bindings/docs/writing- bindings/writing-bindings.sgml?rev=1.1&view=markup (anybody have a link to that in html? google has failed me...)

You will *definitely* want to read Mathieu Lacage's paper on the Glib Object system: http://le-hacker.org/papers/gobject/


The hardest part will be binding GObject in a way that is natural for octave. You will want it to be idiomatic (do things in the standard octave ways) and as automatic as possible (if you can make the bindings handle memory management of the widgets and structs (e.g., no unref/free needed in user code), your users will love you). I strongly urge you, for your own sake, to attempt to keep API deviation to a minimum, to lower the learning curve and allow people to use all the copious C gtk+ docs with your binding. Once you get GObject bound, the rest is usually easy to take care of with a code generator.


In the view of the above idea, I would like to know how language bindings work & how I could use the GTK+ accessible from Octave. Octave, for the record *does not* support call by reference. I have looked into the way Matlab does work around this. Its costly, but it passes around the values of the *all widgets* to all the function-callbacks registered with the system on compiletime and uses a lot of global variables.

You may be able to work around this, if you make some evil assumptions. Assume that you have an int large enough to hold a pointer on all platforms. Then you could turn the widget pointers into integers that you'll use as "handles" in octave.

Does octave have an object model? (I haven't used it much beyond doing ffts and state models and such, forgive my ignorance.)


--
I bring the rock, and provided it is fiscally responsible, I will bring the funk as well. And that's fo-shizzle.
	-- Saturday Night Live




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