[lazarus] Progress

Michael A. Hess mhess at miraclec.com
Tue Aug 31 19:46:45 EDT 1999


Marc Weustink wrote:
> 
> Why not ?

For the reason I explained right after.
 
> >The reason is due to the fact that ALL and I mean ALL of the
> >generation of the Button, how it looks, how it is drawn, how it
> >reacts to events is found in and controled by the GTK library.
> 
> OK, but if you found a way to pass drawing to the canvas of the
> LCL-button to the widget-librar, then I cant see why it's wrong to
> inherit a LCL button and add your own stuff.\

Because you can't. All of the events that are generated by a component
are done IN the GTK library. The LCL does not generate any events for
any components, EVER. It only receives events that are passed to it from
the GTK lib that were generated by the GTK widget that was made by the
GTK library. The LCL is acting as a wrapper around the GTK library
widgets and the wrapper is being made to look like the same kind of
classes found in Delphi. However the LCL doesn't have any control over
the widgets themselves. They are made by the GTK lib. You can not
override the drawing of a GTK widget from within the LCL. That is part
of the C code within the GTK library.

> If you have to do this in the lib's then youend up implementing one
> for every lib!

Well it is done in the lib because that is were the GTK code is. Yes if
you want to create a new fancy component and want it to be used with
whatever API someone wants to use then you need to build it for EVERY
API. If you don't then you will be subjecting the user to only using the
API that you designed it for. There isn't anything we can do about that.
 
> >If you want to create a new component like that you need to modify
> >the GTK library. You can't do it from within Lazarus or the LCL.
> >
> >We have to keep this separation so that we can support alternate API
> >libraries. The minute you add that feature to GTK and us it in your
> >program you remove the possibility of using other API's if they do
> >not also have that same component.
> 
> Thats what I like about Lazarus. We shouls use core componets
> available in all API's or components based upon/constructed by these
> core components. If I see it correcvtly these should be in the LCL and
> not in the API-lib.

Again you don't seem to understand how the APIs work. Lazarus and the
LCL doesn't create ANYTHING. All components are created in the GTK lib.
There are no core components to create in the LCL. Everything is created
by the widget library. The LCL is acting as a standard wrapper to manage
the widgets no matter which API is used to create them. As I mentioned
earlier this wrapper is just being made to LOOK like the Delphi class
library but it doesn't actually do the work of the Delphi VCL.

It was mentioned in the first post about "waiting to find out about GTK
primitives". There are NO GTK primitives. GTK is the widget library that
creates components in windows with events. The GTK widget library is
built ontop of the GDK Graphics Library.

Here is a layout of the libs. when using GTK+

   -------------------------------------------------------
   |                    Application                      |
   -------------------------------------------------------
                             |
                             |
   -------------------------------------------------------
   |                    Lazarus/LCL                      |
   -------------------------------------------------------
      |                                   |          |
      |                                   |          |
      |                                   |      ---------
      |      |----------------------------|------|  GTK  |
      |      |                            |      ---------
      |      |                            |          |
      |      |                            |          |
      |      |                        --------------------
      |      |      |-----------------|        GDK       |
      |      |      |                 --------------------
      |      |      |                           |
      |      |      |                           |
   -----------------------            --------------------
   |        GLIB         |            |      X Window    |
   -----------------------            --------------------


When using Gnome it gets even more complex because another layer which
is Gnome sites inbetween Lazarus and the GTK+ library.

What I am trying to make everyone understand is that the LCL doesn't
call any primitives to actually draw anything as far as components go.
You might call some primitives to do some actual drawing within a GTK
Drawing Widget but you can't CREATE or make an OwnerDrawn component when
using GTK unless you create it in "C" and add it to the GTK library.

I ask again.    Is this clear???

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list