Am Samstag, den 10.11.2007, 14:11 +0100 schrieb Mattias Gaertner:
> On Sat, 10 Nov 2007 15:55:38 +0300
> Al Boldi <[EMAIL PROTECTED]> wrote:
> 
> > Mattias Gaertner wrote:
> > > I think ParentWindow is very widgetset specific (see below).
> > > Probably it will work cross platform very limited. See at end for an
> > > alternative solution.
> > >
> > > - AFAIK under winapi you can stack handles even of different
> > > processes. gtk does not allow this. I don't know about qt, carbon,
> > > fpgui, but probably they all have some limitations of child/parent
> > > relationships.
> > 
> > Actually the gtk does support this, but in a really hacky way, using 
> > GTKSocket/GTKPlug.
> 
> I see. So, you need special handles under gtk, while winapi allows
> nearly any window handle. Then I guess, ParentWindow will be far too
> complicated to implement cross platform in a generic way.

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.

> > 
> > > - the LCL handles messages and delegates them downwards and upwards
> > > to parents/childs TControls. But if the Handle has no associated
> > > TWinControl then messages can not be passed this way. Only the
> > > widgetset knows how to handle this. You must check every place
> > > where a handle is used if it is
gtk_widget_get_parent() a normal LCL handle or a foreign
> > > handle. This will be a lot of work.
> > >
> > > Solution:
> > > It is probably easier to create a wrapper TWinControl / TCustomForm
> > > with the ability to use the foreign Handle.
> > 
> > Correct; all that is needed is a SetParent(hWnd) method.
> 
> Huh?
> 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?

Marc


_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to