[Lazarus] Getting X Window handle ?

zeljko zeljko at holobit.net
Tue Nov 6 10:33:35 CET 2012


On Tuesday 06 of November 2012 09:58:58 michael.vancanneyt at wisa.be wrote:
> On Tue, 6 Nov 2012, Hans-Peter Diettrich wrote:
> > Michael Van Canneyt schrieb:
> >>>> How can I get access to the low-level X window handle (id) of a
> >>>> TWinControl
> >>>> on Linux ?
> >>> 
> >>> It's not so problematic. Look at qtx11.inc in lcl/widgetset/qt or in
> >>> gtk2widgetset.inc (there's IFDEF X11 or similar) which gets X11 TWindow
> >>> from
> >>> GdkWindow.
> >> 
> >> Actually, it is in gtk2proc, FormToX11Window :-)
> >> 
> >> Thanks.
> >> 
> >> The function could accept a TWinControl instead of TCustomForm I would
> >> think.
> > 
> > AFAIK X11 only supports handles for top level windows, managed by the
> > window manager.
> 
> This is not correct.

+1. It's correct ONLY if widgetset lib (qt, gtk2) uses alien widgets, in that 
case form is only x11 handle, but (at least with qt) you can always create an 
widget as "native" ,so it'll have native x11 handle (panel,button 
...anything).

zeljko




More information about the Lazarus mailing list