[lazarus] Progress

Marc Weustink weus at quicknet.nl
Wed Sep 1 16:33:07 EDT 1999


At 19:47 31-08-99 -0400, "Michael A. Hess" <mhess at miraclec.com> wrote:
>Marc Weustink wrote:
>> 
>> 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. 

Thats clear since:

>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.

That maybe a lack of the GTK lib. If you want to be a good standin for
Delhpi and not just another graphic pascal ide, an application developer
should be able to create it's own components derived for a random class
using solely Lazarus/LCL. When s/he also has to dive into the functionality
of the used underlying lib, then why use Lazarus at all. Then you will end
up with something like VB, where, if you want some extra functionality, you
end up hacking API in stead of straight using the tool.

>> 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. 

Maybe, maybe not.

>Lazarus and the
>LCL doesn't create ANYTHING. All components are created in the GTK lib.

In my opinion, not necessary all. 
Yes, for a control at least TWincontrol should be created in the
(interface) libs. From there every component could be created from it
whithin the LCL. Then you're allmost complete platform independent. I know
this is extreme, since you have to do it all your own. But being platform
independed you sometimes have to.

>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.

The Delphi VCL is sometimes just a wrapper itself. 
It is sometimes a wrapper, sometimes it implements components itself,
because the windows functionality is to poor.

>Here is a layout of the libs. when using GTK+
>
>   -------------------------------------------------------
>   |                    Application                      |
>   -------------------------------------------------------
>                             |
>                             |
>   -------------------------------------------------------
>   |                    Lazarus/LCL                      |
>   -------------------------------------------------------
>      |                                   |          |
>      |                                   |          |
>      |                                   |      ---------
>      |      |----------------------------|------|  GTK  |
>      |      |                            |      ---------
>      |      |                            |          |
>      |      |                            |          |
>      |      |                        --------------------
>      |      |      |-----------------|        GDK       |
>      |      |      |                 --------------------
>      |      |      |                           |
>      |      |      |                           |
>   -----------------------            --------------------
>   |        GLIB         |            |      X Window    |
>   -----------------------            --------------------
>

As an application developer I would like to see this a bit more abstract

   -------------------------------------------------------
   |                    Application                      |
   -------------------------------------------------------
                             |
                             |
   -------------------------------------------------------
   |                    Lazarus/LCL                      |
   -------------------------------------------------------
                             |
                             |
   -------------------------------------------------------
   |                  Some interface                     |
   -------------------------------------------------------
            |                 |                  |
            V        or       V         or       V          or ?
   -----------------    ---------------    ----------------|
   |../GLIB/GTK/.. |    |  WIN32      |    | some other lib|
   |               |    |             |    | I dont want to| 
   |               |    |             |    | know about    |
   -----------------    ---------------    -----------------

I don't want to know what lib there is. If I want to use a LCL component
and I don't like its face, I want to repaint it. I don't want to dig in the
dirt (whatI've been doing to long ;-)

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

That a problem of the lib builder. Not for just somebdy using Lazarus.

>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.

Thats clear. But it doesn't say that if we need the ability to draw
something and the GTK libs doesn't support this, that we can't use it. What
about platform independence. As long as the GTK-libs it will support we
will implement the required functionality in LCL? It think this is THE way
to get platform dependent!

>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???

As I said before. If you want to keep (for instance) the ownerdraw out of
the LCL simply because GTK does not support it (wich I ussume from earlier
postings), I do. But, if you want to be platform independent and port
Delphi since Borland won't, I'm completly lost.

Marc







More information about the Lazarus mailing list