On Sun, 11 Nov 2007 09:16:04 +0100
Marc Santhoff <[EMAIL PROTECTED]> wrote:
>[...]
> Only out of curiosity:
>
> Wouldn't a X Windows window ID do? I think that's the equivalent to
> WinAPIs handles.
>
> GDK_WINDOW_XWINDOW (GTK_WIDGET (my_window)->window);
>
> is the function/macro to use then.
>[...]
> > Maybe my statement was not clear: The Parent/Child connection is the
> > main problem. It would be easier to handle the child/parent
> > relationship by the LCL and keep the 1:1 mapping between controls
> > and handles.
>
> But GTK does have the functions
>
> gtk_widget_get_toplevel()
> gtk_widget_get_ancestor()
> gtk_widget_get_parent()
>
> So the GTK-binding could use them?
Again in other words:
Of course reparenting is possible under all platforms. The LCL use it
everywhere. The problem is that it works different under all
platforms, so you need a wrapper: The LCL is a TWinControl
wrapper to make reparenting possible platform independently.
Reparenting by Handle is the opposite way.
It's easy to do on one platform (e.g. Delphi on win32), but it's very
complex to do it on all platforms. Especially the whole LCL code must
be checked. So it will be a lot of work. And who will maintain it? It
seems only very few people will use this feature, so it will hardly be
tested and probably it will break by the next patch.
Conclusion:
It is technically doable, but it will need a lot of work and will
hardly be maintained.
That's why I propose a TForeignHandleControl. That will be easier. It
can be implemented as package and can start first on the windows
platform. And when it works on all platforms it can be added to
the LCL. See for example the trayicon, openglcontrol and
printers4lazarus packages.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives