[lazarus] Wrapping glib with objects

John Margaglione jmargaglione at hotmail.com
Mon Jun 14 17:48:36 EDT 1999

> > 1.  glib likes to pass around gpointers.  I like to pass around
TObjects.  There are merits in doing both.
> > By passing around TObjects we wave the application programmer from
constantly doing this: pointer( thing ).
> >  But, by restricting the user to TObjects, they can't store records.
The obvious solution is to overload
> > the Inser function so that it accepts both pointers and TObjects.  Any
other suggestions?
> Why not make it a descendent of TList or TStrings (with whatever
enhancements you want) ?
Well, I don't think a hashtable, map, or other non-linked list class would
fit that interface very well.  About the only one that maps well is the
singly-linked list.

> TThread is implemented already. If possible, a descendent should be used.

I am thinking that TThread is fine for Delphi portability, but that a more
comprehensive thread management interface will be needed.  But for the
creation of threads, I agree that there should be one interface: TThread.
Perhaps a descendant class with a few extra methods.

Thanks for the comments,

John Margaglione
jmargaglione at xnet.com

More information about the Lazarus mailing list