Re: GtkPlot widget



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 26 Nov 1999, Hassan Aurag wrote:

> I just got the gtkplot widget from repository and it looks fabulous.
> 
> Now I know nothing about C. Anyone care to help in porting this to 
> Python?

I don't know how the pygtk bindings but in GtkAda the Ada objects
merely store the address of the object returned by the C
functions. The user of the binding obviously doesn't use these.

This brings me to something slightly different but related. I'm
currently building Ada '95 bindings to GNOME, and have run into a
problem with a number of the widgets and librarys. In a number of
cases signifcant functionality is provided in the form of
pre-processor macros which fufill the function of accessor/mutator
procedures for objects but merely expand to something like
object->foo.

This poses problems for people who write bindings since it means
either creating an equivalent object in the other language and
providing accessor/mutator procedures for it that keep it in sync with
the appropriate gtk object (which isn't guaranteed to work[1]) and
doubles (at least) the amount of memory used. The alternative is that
binding writers create a layer of C glue between the binding and the
library itself to do this. This is a much better approach, but
increases the amount of work needing to be done and will almost
inevitably lead to the duplication of effort.

The way to avoid this is to provide appropriate functions for
manipulating gnome objects instead of macros and direct manipulation
of objects (which requires direct knowledge of the implementation and
is thus Bad from a B&D programming perspective). I think that the best
way of doing this right now is to add a pair of -binding files (.c and
.h) for the various libraries for which this is a problem in 1.0 and
and then to incorporate those into 1.1 so that applications don't
break. The functions can have the same names and paramater layout as
the existing macros so no changes to source code are necessary, but
things that access structure internals directly will need to be
changed from foo->bar to bar(foo) (returning an object of the same
type as bar) which will require changes to source code but is the same
number of characters.

I'm willing to do the work to create the -binding files, it's easy and
doesn't require terribly much thought. I don't have write access to
CVS so I'll need somewhere to mail the files too to get them in.

- - Aidan

[1] If the object is modified internally by gtk functions then the
object and it's synonym will get out of sync.
- -- 
"I say we just bury him and eat dessert"
http://www.skinner.demon.co.uk/aidan/
OpenPGP Key Fingerprint: 9858 33E6 C755 7D34 B5C5  316D 9274 1343 FBE6 99D9

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: please see http://www.skinner.demon.co.uk/aidan/keys/ for keys.

iD8DBQE4PxVkWyka/GZM+OgRAqGuAJ9X/LHdflh61chAUwm1CZtjf1oPcwCgrq85
RNAl54E2Zqwxuh3HumANDXw=
=s92G
-----END PGP SIGNATURE-----



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