Jeffrey A. Wormsley
daworm at cdc.net
Wed Sep 1 18:10:13 EDT 1999
On 9/1/99, at 3:58 PM, Michael A. Hess wrote:
>But this works if and only if the current component fires a callback for
>a mousemove event. If the component doesn't support that then there is
>no way to add the mousemove event to the GTK component. That is the
>point I am trying to make everyone understand. If the event isn't
>already supported by the component (and I am not talking about the user
>designed event like above) which will deliver a callback then you can't
>add the event. The only way to add it would be to modify the "C" code in
>the GTK library.
I think that we are all, in a sense saying much the same thing, only you do
not want to go to the level that others want to go. It is clear that you
can't add things to a GTK component at the LCL level. There are really two
First, what do you do when you want something that is not a part of GTK,
and can't be created by combinations of existing GTK components? Possible
1. Do without. That feature cannot and will not exist.
2. Go into the GTK code, create a new component in C with the desired
behavior based on the original one, submit it to the GTK team, and if/when
it becomes part of the GTK libraries, use it.
3. Go into the GTK code, translate the high level C into Pascal, build the
widget as desired in lazarus code, calling low level GTK code (if that is
even possible without static linking).
4. Create a new equivalent component from scratch in Pascal, possibly
translating large portions of GTK code or making a low level X version for
linux (which means it would still work in any window toolkit, but may lack
look and feel), and a low level WinAPI version for Windows, and a ??? for
Second, who is the audience of the above question? By that I mean, are we
talking about application developers or lazarus developers.
An application developer won't be likely to ever attempt 2 - 4.
A lazarus developer might be willing to try one or more of these avenues.
Not knowing enough about the GTK team to be sure, but it seems that they
would be more than willing to have new components added to their
collection. Chapter 15 of "Developing Linux Applications with GTK+ and
GDK" covers creating your own widgets, likewise section 22 of the GTK v1.2
Tutorial. If we want the LCL to be as complete as possible, it may be up
to us to fill in some of the deficiencies of some of the API's. Sure, it
would be stupid to recreate from scratch something that already exists.
But it may be, from time to time, some of us may be willing to step outside
of lazarus to make sure lazarus is as useful as possible. There will also
be times that this is more trouble that it is worth. For instance, I
really doubt anyone would want to add DirectX or RingZeroGDK to linux!
>> Think about it, if you create a component that extends itself off of
>> TBUTTON and want to add events that aren't handled by default, you
>> have to do a dispatch or call a procedure manually.
>Exactly what do you think you could call to get the GTKMain event loop
>to recognize and send a callback for an event it wasn't designed to
More information about the Lazarus